Closed mayako21126 closed 3 years ago
i think it due to nodejs version conflict
eslint 7.0 need 12.0.0 but .travis is 8.10.0
Looking forward to seeing this get in!
@kisenka Is there a plan to merge this PR for upcoming webpack 5 support?
@kisenka Is there a plan to merge this PR for upcoming webpack 5 support?
+1 -- this is the last Webpack library we're using (at least that I'm aware of 🤞 ) that still needs to get updated before we can upgrade to Webpack 5. 👀
Likewise- we've been eagerly awaiting this update!
Sorry to bug but any updates on this? What work is left that's preventing this from getting merged down...?!
@kisenka can this be at least released in a beta release? It's the only loader remained preventing us from upgrading to webpack 5.
Great work! I can only recommend the merge, because it solves the problem with Webpack5 compatibility.
Workaround tip, as long as the PR is not merged: Fork the repository of @mayako21126 and create a private NPM package here in Github.
That way I bridge the time when you can work with the package here again.
Webpack 5 officially reaches the release candidate: https://github.com/webpack/webpack/releases/tag/v5.0.0-rc.0
@kisenka It would be nice this PR gets merged
This worked for me. Looking forward to a release version.
This branch has worked great for me with webpack 5. Webpack 5 is released two days ago. Would there be an effort to merge this?
merge please.
Great work! I can only recommend the merge, because it solves the problem with Webpack5 compatibility.
Workaround tip, as long as the PR is not merged: Fork the repository of @mayako21126 and create a private NPM package here in Github.
That way I bridge the time when you can work with the package here again.
@christophstockinger @mayako21126 I tried to fork the repo with the changes from this PR. Unfortunately, the webpack-5
environment does not start and therefore I can not release a private package. The guide in CONTRIBUTING.md
is a little rough. How did you manage to get this to work?
# git clone # from https://github.com/mayako21126/svg-sprite-loader
# git checkout add-support-webpack5
$ sh scripts/build.sh
#...
Running node v12.18.1 (npm v6.14.5)
yarn install v1.22.4
info No lockfile found.
[1/4] Resolving packages...
warning extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
[2/4] Fetching packages...
error terser@5.3.6: The engine "node" is incompatible with this module. Expected version "^10.0.0,^11.0.0,^12.0.0,>=14.0.0". Got "12.18.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
webpack-5 env installed
Update: terser@5.3.6
breaks compatibility with Node 12 LTS, 5.3.7
was released as a fix.
$ yarn release
$ node scripts/build-runtime.js
/.../svg-sprite-loader/scripts/build-examples-dll.js:32
throw new Error(msgs.join('\n'));
^
Error: BUILD EXAMPLES ERRORS
Module not found: Error: Can't resolve 'svg-sprite-loader' in '/.../svg-sprite-loader/examples/browser-sprite-with-dll'
@rohrlaf, I don't know what "private package on Github" means, and how to make it, so this is what I did. It may be a bit incorrect or suboptimal, but worked for me.
So I:
1) made a fork
2) npm run build:runtime
to get *.build.js files in runtime
directory
3) corrected version in package.json to "version": "4.99.99"
, to avoid any conflicts with official versions
3) pushed this files to repo
4) url to repo in package.json:
"svg-sprite-loader": "git+http://[your_host]/svg-sprite-loader-fork.git#[commit_hash]",
Note, my git server uses http. Maybe that will be ok for you.
Can this be merged?
@rohrlaf, I don't know what "private package on Github" means, and how to make it, so this is what I did. It may be a bit incorrect or suboptimal, but worked for me.
@shameleo Thanks for your help, I tried to make it work but still not running for me. Replaced svg-sprite-loader
with the patch from @mayako21126, but the react-styleguidist will not work.
With "private package" I meant publishing it on a private registry, as we can not alter svg-sprite-loader
on the NPM registry.
$ git clone git@github.com:mayako21126/svg-sprite-loader.git
$ git checkout add-support-webpack5
$ npm/yarn install
$ npm run/yarn build:runtime
# change name to "@myorg/svg-sprite-loader" and "publishConfig" in package.json
$ npm login # login into the private registry
$ npm/yarn publish
Nevertheless, for the node_modules
install your HTTP approach or the package publishing should not make a difference. I still can not make the build work, although doing the same steps to generate the runtime
files.
With patch by @mayako21126:
(node:16489) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
With current svg-sprite-loader@5.0.0
:
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Hash.update (internal/crypto/hash.js:82:11)
at BulkUpdateDecorator.update (myproject/node_modules/webpack/lib/util/createHash.js:49:14)
at NormalModule.updateHash (myproject/node_modules/webpack/lib/NormalModule.js:1042:8)
at Compilation.createModuleHashes (myproject/node_modules/webpack/lib/Compilation.js:2599:12)
at myproject/node_modules/webpack/lib/Compilation.js:1952:11
at Hook.eval [as callAsync] (eval at create (myproject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (myproject/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at myproject/node_modules/webpack/lib/Compilation.js:1914:36
at Hook.eval [as callAsync] (eval at create (myproject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (myproject/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at Compilation.seal (myproject/node_modules/webpack/lib/Compilation.js:1905:27)
at myproject/node_modules/webpack/lib/Compiler.js:981:20
at myproject/node_modules/webpack/lib/Compilation.js:1724:4
at eval (eval at create (myproject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)
at myproject/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:332:11
at myproject/node_modules/neo-async/async.js:2830:7
error Command failed with exit code 1.
It looks like there's a https://github.com/JetBrains/svg-sprite-loader/pull/365 pull request that's also supposed to fix this library on Webpack 5. Not sure which pull request is better 🙂
@Slashgear, Sorry to bother you, but are you still a maintainer for this repository?
It looks like there's a #365 pull request that's also supposed to fix this library on Webpack 5. Not sure which pull request is better slightly_smiling_face
@Bosch-Eli-Black thanks for pointing this out. #365 is based on svg-sprite-loader@4.1.6
, whereas this PR is based on svg-sprite-loader@5.0.0
. Nevertheless, both versions cause the same deprecation warning and never finish the build for me: DeprecationWarning: Compilation.assets
It looks like there's a #365 pull request that's also supposed to fix this library on Webpack 5. Not sure which pull request is better slightly_smiling_face
@Bosch-Eli-Black thanks for pointing this out. #365 is based on
svg-sprite-loader@4.1.6
, whereas this PR is based onsvg-sprite-loader@5.0.0
. Nevertheless, both versions cause the same deprecation warning and never finish the build for me:DeprecationWarning: Compilation.assets
Ah, cool; I hadn't noticed that difference.
Are you sure the build is hung and isn't just still running? I know I've seen some people reporting that upgrading to Webpack 5 increased their projects' initial build times. Just curious what might happen if you left the build running for, say, 15 minutes XD
Great work! I can only recommend the merge, because it solves the problem with Webpack5 compatibility. Workaround tip, as long as the PR is not merged: Fork the repository of @mayako21126 and create a private NPM package here in Github. That way I bridge the time when you can work with the package here again.
@christophstockinger @mayako21126 I tried to fork the repo with the changes from this PR. Unfortunately, the
webpack-5
environment does not start and therefore I can not release a private package. The guide inCONTRIBUTING.md
is a little rough. How did you manage to get this to work?bootstrap
# git clone # from https://github.com/mayako21126/svg-sprite-loader # git checkout add-support-webpack5 $ sh scripts/build.sh #... Running node v12.18.1 (npm v6.14.5) yarn install v1.22.4 info No lockfile found. [1/4] Resolving packages... warning extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin [2/4] Fetching packages... error terser@5.3.6: The engine "node" is incompatible with this module. Expected version "^10.0.0,^11.0.0,^12.0.0,>=14.0.0". Got "12.18.1" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. webpack-5 env installed
Update:
terser@5.3.6
breaks compatibility with Node 12 LTS,5.3.7
was released as a fix.release
$ yarn release $ node scripts/build-runtime.js /.../svg-sprite-loader/scripts/build-examples-dll.js:32 throw new Error(msgs.join('\n')); ^ Error: BUILD EXAMPLES ERRORS Module not found: Error: Can't resolve 'svg-sprite-loader' in '/.../svg-sprite-loader/examples/browser-sprite-with-dll'
do you installed nvm? I solved nodejs version conflict with it
now work with 5.0.0-rc.6
@mayako21126 @Bosch-Eli-Black, @KingSora and I found the culprit. As we were trying to publish the forked patches for svg-sprite-loader
we published the packages in our private registry with @orgname/
. As it seems, either Webpack or this loader has problems with scoped package names, but also the Webpack build was not throwing any errors. Now that we use the package without the @orgname/
scope, things run smoothly :sweat_smile:
If this PR is good, I'd love to see it merged and released. We'd like to move to Webpack 5 here (because of module federation), but this plugin is a blocker.
Now that we use the package without the @orgname/ scope, things run smoothly 😅
What is the full package name for that fork, which works with Webpack 5? (I'd like to use it, until the official svg-sprite-loader
package is updated with the fix)
Now that we use the package without the @orgname/ scope, things run smoothly sweat_smile
What is the full package name for that fork, which works with Webpack 5? (I'd like to use it, until the official
svg-sprite-loader
package is updated with the fix)
Sorry to disappoint, my company policies did not allow me to publish an open source package. We only have it available from our private registry.
How I did it:
5.0.0
of this loader (only need this loader to be compatible with Webpack 5, so this is shorter than https://github.com/JetBrains/svg-sprite-loader/pull/403)npm build:runtime
package.json
to (prefix)-svg-sprite-loader (as
@scope/` does not work)npm login
to the registry for uploadnpm publish
to release this packageWebpack Maintainer here 👋 can we get some official movement or merges on this project? If dead then i can fork it and maintain a copy. But there needs to be some update since users seem to have patched the problems it had
Webpack Maintainer here 👋 can we get some official movement or merges on this project? If dead then i can fork it and maintain a copy. But there needs to be some update since users seem to have patched the problems it had
Can't wait to see it.
Webpack Maintainer here 👋 can we get some official movement or merges on this project? If dead then i can fork it and maintain a copy. But there needs to be some update since users seem to have patched the problems it had
@ScriptedAlchemy considering the last commit to master was over 6 months ago and (as far as I can tell) there hasn't been any signs of movement on getting this OK'd and merged, I'm starting to think forking might be our only option here 🙁
Hey, folks!
Unfortunately, the maintainer of this project passed away.
Currently, I need some time to get into and check pull requests. I'll start with this PR next week.
@d3x42 Damn. I am so, so sorry to hear that - my sincere condolences. 😞
Take all the time you need (and really appreciate you letting us know).
That's really sad to hear 😟 @kisenka seemed like a nice guy, on the occasions that I had to talk to him.
Looking forward to seeing this get in!
I beg of you, just merge this PR already, it's been like half a year. We have entire projects that can't update to webpack 5 just because of this one loader.
Thank you, very appreciated.
Thank you for merging this but it looks like the CI is stuck and I guess we won't get a release until it passes?
@matthewma7 Yes, build already queued.
@kisenka Please review and publish a release with this feature.
@SevenOutman the guy is dead, bro. He's not going to publish anything. Read the message history above.
@shakhbulatgaz sorry to hear that :(
Currently, I didn't have access to publish it in npm, so I'll try to find someone who could grant it. After that, I'll publish the release.
If the maintainer of an npm package is deceased, NPM support can help transfer ownership to a new maintainer. I saw this happen recently with the firebase-mock
package: https://github.com/soumak77/firebase-mock/issues/160
In this case, it may be easier (eg. less of a waiting delay) since the package repo was hosted under an organization, rather than an individual's Github account.
5.1.1 published
Great job, but plugin have dependency from incompatible version of html-webpack-plugin
. I guess 6.x version should be published instead, with dependencies update.
when i upgrade to v5.1.1, this error still exist. @d3x42 @rohrlaf
(node:55321) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView. Received type undefined
at Hash.update (internal/crypto/hash.js:58:11)
at BulkUpdateDecorator.update (/Users/qiliu/gaoding/delarue/node_modules/webpack/lib/util/createHash.js:49:14)
at NormalModule.updateHash (/Users/qiliu/gaoding/delarue/node_modules/webpack/lib/NormalModule.js:1048:8)
at Compilation.createModuleHashes (/Users/qiliu/gaoding/delarue/node_modules/webpack/lib/Compilation.js:2619:12)
at hooks.optimizeChunkModules.callAsync.err (/Users/qiliu/gaoding/delarue/node_modules/webpack/lib/Compilation.js:1957:11)
at Hook.eval [as callAsync] (eval at create (/Users/qiliu/gaoding/delarue/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/qiliu/gaoding/delarue/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at hooks.optimizeTree.callAsync.err (/Users/qiliu/gaoding/delarue/node_modules/webpack/lib/Compilation.js:1917:36)
at _err0 (eval at create (/Users/qiliu/gaoding/delarue/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
at handleCompilationDonePromise.then (/Users/qiliu/gaoding/delarue/node_modules/html-webpack-plugin/lib/cached-child-compiler.js:237:53)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:55321) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:55321) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@ogonkov Fell free to add PR with updates
Great job, but plugin have dependency from incompatible version of
html-webpack-plugin
. I guess 6.x version should be published instead, with dependencies update.
What kind of change does this PR introduce? (bugfix, feature, docs update, improvement) feature What is the current behavior? (You can also link to an open issue here) it doesn't work with Webpack5 What is the new behavior (if this is a feature change)? Make it compatible with Webpack5 Does this PR introduce a breaking change? no Please check if the PR fulfills contributing guidelines ok
but some Webpack5 changes caused the test to be error for example “MultiEntryPlugin”