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 build & add node 10 #64

Merged
merged 3 commits into from
May 6, 2020
Merged

Conversation

seanparmelee
Copy link
Collaborator

I'm using Node 10.16.0 and when I run yarn in this project, I get:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.16.0"
error Found incompatible module.

I tracked this dependency back to Webpack so I went ahead and bumped webpack and webpack-cli to the latest versions.

But then the next problem I ran into was with the integration tests failing due to a webpack error:

Conflict: Multiple assets emit to the same filename bundle.js

Turns out there was a breaking changing in karma-webpack that happened since the last time inject-loader was released. I went ahead and fixed that here too.

plugins: [
new webpack.DefinePlugin({ __VALUEA__: 10 }),
],
plugins: [new webpack.DefinePlugin({__VALUEA__: 10})],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for this noise; I'm guessing this was prettier kicking in since I changed this file?


output: {
path: path.resolve(__dirname, './dest'),
filename: 'bundle.js',
filename: '[name].js',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the fix for the aforementioned karma-webpack issue. In 3.0.0 (which was the latest version the last time inject-loader was released), this filename was always hardcoded to [name], but then that changed with codymikol/karma-webpack#336, which also introduced the error we're seeing now. Unfortunately, the fix never made it into a 3.x release so we could either pin to karma-webpack 3.0.0 or make the change I made here.

@@ -12,7 +12,7 @@
"jsdom": "^11.7.0",
"karma-jasmine": "^1.1.1",
"karma-jsdom-launcher": "^6.1.3",
"karma-webpack": "^3.0.0",
"karma-webpack": "^4.0.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, karma-webpack 3 isn't meant to be used with webpack 4 (codymikol/karma-webpack@c1c0ee2) so I bumped it for the webpack 4 example

@@ -22,7 +22,7 @@ module.exports = {

output: {
path: path.resolve(__dirname, './dest'),
filename: 'bundle.js',
filename: '[name].js',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is more for consistency with the the other examples, but we could technically use bundle.js here since the issue is fixed in karma-webpack 4

@@ -1,8 +1,7 @@
language: node_js
node_js:
- 9
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like some modules are only compatible with LTS versions of node so I also removed 9 & 7

error [email protected]: The engine "node" is incompatible with this module. Expected version "6.* || 8.* || >= 10.*".

@seanparmelee
Copy link
Collaborator Author

Hi @plasticine, are you still interested in maintaining this project? In addition to this PR, there's some additional work I did that I'd like to contribute back including adding support for ESM and upgrading to Babel 7.

@plasticine
Copy link
Owner

plasticine commented Jun 28, 2019

Hey @seanparmelee, thanks for the message!—and the PR! Sorry for the delay in getting back to you on this, I’ve been a little busy this week, but I’m hoping to catch up on this PR on the weekend!

@seanparmelee
Copy link
Collaborator Author

Hi @plasticine, think you might be able to get to this sometime this week or weekend? Thanks in advance!

@seanparmelee
Copy link
Collaborator Author

Hello again @plasticine, any chance you're available to review this?

@seanparmelee
Copy link
Collaborator Author

Hey @plasticine, wanted to get this on your radar again since it's been a few months.

@seanparmelee
Copy link
Collaborator Author

Hello again @plasticine @vladimir-tikhonov 👋

As I was mentioning before, there's some additional work I'd like to contribute back to this project including adding support for ESM and upgrading to Babel 7. Happy to take ownership or become a collaborator If you're too busy or no longer interested in this project.

@treyp
Copy link

treyp commented Apr 22, 2020

thanks for this fix @seanparmelee ! also hoping to get the node 10 support here, and node 12 soon too.

@vladimir-tikhonov
Copy link
Collaborator

vladimir-tikhonov commented Apr 22, 2020

Hi @seanparmelee, and thanks for you contribution! Changes look good to me. As you probably noticed I'm no longer involved in this project (and never was tbh). While I have permissions to merge you code into master, I don't have any access to inject-loaded package itself, so that will be kinda pointless. I think it will be better to maintain your own fork until @plasticine decide what to do. If you want to publish it to npm I can transfer to you right to conviniently named injectify-loader package that I no longer use.

@seanparmelee seanparmelee merged commit 804e729 into plasticine:master May 6, 2020
@seanparmelee seanparmelee deleted the node10 branch May 6, 2020 14:35
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.

4 participants