Skip to content
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

Fix server scripts runtime error due to mixed import and require usage #105

Merged

Conversation

ypahalajani
Copy link
Contributor

@ypahalajani ypahalajani commented Oct 5, 2019

The error arose when you run npm run watch which produces a fresh bin/server.js chunk containing mixed import and require syntax and then, run npm run server:dev which runs the server.js produced from last command.

Refer this.

PS: I edited the build to watch in the above statement.

@anikethsaha
Copy link
Owner

error arose when you run npm run build

you meant the webpack or watch command ?

@ypahalajani
Copy link
Contributor Author

error arose when you run npm run build

you meant the webpack or watch command ?

Oh yeah! i forgot, you updated the build to watch. And, yes, I meant the watch command

@anikethsaha
Copy link
Owner

anikethsaha commented Oct 5, 2019

Okay, let me look into it.

As far as this is concerned this should not happen as those are webpack output files.
Webpack should not output files having import statements in them ! thats what babel-loader is there for
I don't know why it's happening. Maybe because of the target: node in the server config.

@anikethsaha
Copy link
Owner

Still dont know why its coming but merging this as this is a valid fix for this issue

@anikethsaha anikethsaha merged commit fc6d4d8 into anikethsaha:master Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants