-
Notifications
You must be signed in to change notification settings - Fork 32
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
Doesn't seem to work any more #15
Comments
Could you create a minimal reproducable example. |
@DeMoorJasper doing so as we speak. I think I replicated the problem incorrectly so I'm looking at ways to replicate it properly first. |
Ok, in trying to recreate this I encountered a different blocking bug which means that I can't progress, so... https://github.com/antony/parcel-plugin-svelte-bug It looks like parcel is telling me that my Slightly confused as to what's going on here. |
Ok, my fault. I'd installed It looks like it works again. I'll close this for now :) Sorry about that! |
Btw - I just realised that |
Ok, I have to reopen this as I'm still encountering it even after switching to Here's a working minimal example as a branch of my seed project: https://github.com/antony/svelte-seed/tree/bug/plugin-svelte |
Ok I've tracked it down. It feels like this might be a parcel bug or a svelte bug, but I can't replicate it on the svelte repl... https://github.com/antony/parcel-plugin-svelte-bug If you use a class name in the 'style' tag of a component which contains a '-', it refuses to compile the component. In the example above, if you change: <style>
.the-time {
font-weight: bold;
}
</style> to <style>
.theTime {
font-weight: bold;
}
</style> It compiles the component without issue. Really weird! |
Awesome, wondering if this goes up all the way to parcel. It’s probably not really related to the plugin, I’ll def look further into this and open a pr/issue in the project this originates from Sent with GitHawk |
I've spent a lot of time trying to debug this, and I think I've narrowed it down to this bit of code: https://github.com/parcel-bundler/parcel/blob/master/src/Pipeline.js#L24 It seems that the svelte files get compiled into three renditions, a { type: 'js',
value: '\n var reloadCSS = require(\'_css_loader\');\n module.hot.dispose(reloadCSS);\n module.hot.accept(reloadCSS);\n ',
final: true } and due to the code above being a hash, the This doesn't really explain why the module is completely missing when the final bundle is output, but it's definitely getting closer to explaining what is going on. |
that's strange it works for vue, I'll have a look at it soonish |
Thanks :) Just in case it is useful, I'm still trying to pin down the issue. I've found that if I comment out the Then svelte components start to work again. Very odd. The reason that the |
Should be fixed in 1.1.4, this is however a hotfix and I'll create a bug report on the parcel repo and follow it up there. |
@DeMoorJasper This is excellent - it works brilliantly - you are an absolute legend! |
🐛 Bug Report
🎛 Configuration (.svelterc, package.json, cli command)
Upgraded all my projects and none of them work any more, with the error
component Xxx is not a function
If you simply clone this project and then point parcel at the index.html file, you will notice that you get the same error:
💻 Code Sample
In your browser console:
🌍 Your Environment
This project's exact dependencies, and NodeJS 9.10.1
The text was updated successfully, but these errors were encountered: