-
Notifications
You must be signed in to change notification settings - Fork 71
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
Webpack 5. Error: TypeError: TypeError: Cannot read property 'data' of undefined #139
Comments
This will be fixed by #136, I have been using Webpack 5 with my svelte-loader fork, and it works with with Webpack
I am, however, getting weird svelte errors in versions after Webpack |
You need to resolve absolute paths. Might be you're passing a regex where it now wants a full path. 28-RC broke several repos. Virtual modules I believe is the main cause. Which writes code to webpack cache, but I'm pretty sure those APIs were changed to an asset lifecycle. Haven't looked deeply but that might be it. Require resolve your paths or you can get the resolution context from require.main and then loop over the resolution paths to find where x module exists, I did this in the fork of next-transpile-modules |
Unrelated issue. You need resolvers for mjs check webpack git issues. I think it's closed now but it was originally tagged as a Babel thing. It might still be pinned to webpack. |
Project author needs to fix their package json field. But mjs resolver mentioned on webpack will fix it till author updates |
{ test: /.m?js$/, type: "javascript/auto",fullySpecified:false}, |
Or fixing that |
@ScriptedAlchemy That helps, thanks! It works after a small correction - fullySpecified should be in "resolve". |
Tell the package authors to fix their shiz. We shouldn't depend on this loader to fix improperly configured packages |
Search closed webpack issues. Look for one titled beta.31 There's a whole thread on the subject there. |
I wasn't able to find the particular thread over there. Could it be this one: webpack/webpack#11467? |
@carsonfarmer Disable module: {
rules: [
...
{
test: /node_modules\/svelte\/.*\.mjs$/,
resolve: {
fullySpecified: false // load Svelte correctly
}
},
...
]
} |
Huzzah! Thanks @Smittyvb, you rock! cc @martinoppitz in case you're still looking for the solution. |
PR works . But the code is not optimized. #136 |
I actually gave that one a try a few days ago before your latest fix (I just snuck it in manually), thanks for that! The only issue I had was with some funkiness with hot reloading IIRC? Looking forward to seeing that merge, at which point I'll give it a go again! |
@Smittyvb, could you help? when p.s use |
the same story here:
Many thanks to Angular for influencing Webpack and the unconsolidated upgrade to v5. |
Please merge #136 |
Not a babel-loader config, its own loader |
Sorry @ScriptedAlchemy , what does you mean?
|
i am using "svelte-loader": "smittyvb/svelte-loader#update-virtual-modules" and am now getting the same error |
@Smittyvb @benmccann @deleonio @lindenquan Is there a plan to accept PRs and finalize fixes for webpack 5 anytime soon? thanks! |
That is solved for us leanupjs/leanup#37. |
Fixes sveltejs#139, Fixes sveltejs#131, Fixes sveltejs#126 Co-authored-by: Smittyvb <me@smitop.com>
Fixes sveltejs#139, Fixes sveltejs#131, Fixes sveltejs#126 Co-authored-by: Smittyvb <me@smitop.com>
Fixes sveltejs#139, Fixes sveltejs#131, Fixes sveltejs#126 Co-authored-by: Smittyvb <me@smitop.com>
@kyrylkov you can use current master until release like this: npm install -D sveltejs/svelte-loader
# or if using yarn 2
yarn add -D svelte-loader@sveltejs/svelte-loader |
@non25 Seems to be working fine. Great job and thanks a lot! |
im in the process of updating all the module federation repos to the final v5
Ive run into issues with svelt-loader, but know very little about svelte..
This is the branch and specific project im trying to run this against:
https://github.com/module-federation/module-federation-examples/blob/update-to-v5-stable/comprehensive-demo/app-04/webpack.config.js
And my webpack config is:
The text was updated successfully, but these errors were encountered: