-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: moduleId should be a string #3576
Comments
|
…resources like css and html. It will compile using ngc, but doesn't work with angular-cli, probably due to this change angular/angular-cli#3576 Todos: * check out it the compiled code is correct * find an alternative way to load css and html (maybe it needs to be webpack anyway :(
I have updated env of my application to use angular cli 1.0.0-beta.30 still I am getting the same error while running tests Chrome 56.0.2924 (Windows 7 0.0.0) AppComponent should render title in a h1 tag |
I'm seeing the same issue as @arvsharm. Is the moduleId stripped out when running tests as well? |
I am able to get the tests working by changing moduleId to string in each of my components Is this solution correct? |
I am seeing the same issue with following config. @angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.26] |
I also seeing the problew, which webpack is compile successfully, but throw error in chrome like following: config is as following: is any solution yet? |
A follow-up PR (#5193) was added recently to resolve a type issue on |
I remove moduleId then the quetion is reslove ...... And you try |
use Will work fine |
|
use my project is working!! |
Would it be too naïve to use __filename instead of module.id? |
Recently encountered this problem regarding angular 2 and a component called jw-pagination To fix, I changed my module.id in both the controller, and the Pagination component to:
Encapsulating the module.id to a string. That fixed it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS
Versions
Repro steps
ng init # Original project where I encountered the bug ng serve
or
ng new someApp # Test to check if related to the project ng serve
With this modification in
src/app/app.component.ts
:@Component({ + moduleId: module.id, selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] })
The log given by the failure
Useful details
I was trying to use angular-cli on an existing Angular2 project, to use the built-in server instead of
lite-server
(which I used before, as it's the method shown in the docs), and after some adjustments, I ended up with this error in the browser (Safari) while the Terminal said everything looked fine.So I tried setting up a new Angular 2 project using
ng new
to compare my code and see what went wrong, but when I tried running the sample project I got the same result.Here are the logs I get while running the sample project with
ng serve
:Any idea what could have been done wrong?
The text was updated successfully, but these errors were encountered: