DEV Community


Posted on

"ng serve - o" does not work, but "ng serve" works

I have Problem with Angular,that after I configure the Micro frontend Framework (module federation) for the remote and the host (the remote and the host not in the same workspace). when I run the App(remote) with "ng serve - o" it shows me this error "Uncaught TypeError: The specifier “module” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”." *in the Console, but when I run the app(remote) with "ng serve" it works without any Problem and the host shows the remote too. I open the Generated js Files: http://localhost:4201/src_app_esg_esg_module_ts-_d58a1.js and http://localhost:4201/src_app_esg_esg_module_ts-_d58a0.js. this 2 Files have in the not working version an extra Line *"import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";" in the top of the File. but in the working version, they have not this line. it is so Confusing and i want to know where can be the Problem. Thx in Advance

I tried to update all the Dependences, Node version, Angular Version, but nothings works

----I tried somthing but it makes the "ng serve" and "ng serve -o" both of them not working: -I remove the node_module and package-lock.json -I run npm Update -then I run npm install after that **nothing **works.... that made it worst

Top comments (0)