-
Notifications
You must be signed in to change notification settings - Fork 67
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
SvelteKit build crash #1111
Comments
Hi @sproott, thanks for providing the reproduction repo! Much appreciated :) Interestingly, when I change the import in This seems like a ESM-related bug. If you look at https://www.npmjs.com/package/quirrel?activeTab=explore, you can see how this works: |
I tried out adding The whole ESM / CJS thing I don't have a lot of knowledge about. Did you find a workaround for this? I'm really at a loss ... |
I'll try to come up with something. How do you test libraries locally? Do you somehow get a project to use a local version? Or do you modify it in node_modules directly somehow? |
I tested it by modifying node_modules. For more complex changes, you can clone the Quirrel repo, run |
Where do I get |
I could take a look at simplifying the whole build process to avoid using the |
Line 61 in 58bb942
I'd prefer to keep the changes minimal, so we don't risk breaking any other setups. |
I have already whipped up a version using EDIT: here is the But I'll continue to investigate the |
Here's the simpler fix using |
Also, I think the |
Thanks so much for opening the two PRs! I looked at the TSUP one, and it seems like that results in bundled output (and can't be turned off). Instead of bundling all files into one, I'd like to keep the So I looked into #1116, which looks good generally. I've found a couple of spots where it breaks existing imports, and at this point, i'm seriously debating if I should just switch this to ESM-only. ESM has been supported since Node v10, and Quirrel only supports Node v14 onwards. I'll work on a PR to switch over to ESM-only, let's see how good that goes. |
Here's my attempt at migrating to ESM, but it's a really big lift and I hope it's worth the hassle 😅 #1117 |
@Skn0tt I don't know if you've done any more progress, but I've found this: https://github.com/unjs/unbuild which supports output without bundling and has a nice frontend for configuration. |
I have this problem also. Although adding the .cjs allows my project to compile, I lose type definitions. Is there any way we can fix the problem? I'm loving quirrel in my sveltekit project. It's exactly the missing functionality I need. |
@sproott Try adding this to your vite.config file
|
Bug Report
Current Behavior
When making a production build of a SvelteKit app that uses Quirrel, it crashes with the following error:
Input Code
This is an empty SvelteKit app with one job queue added, which is enough to make the build crash: https://github.com/sproott/quirrel-sveltekit-build-bug
Expected behavior/code
The app should build successfully.
Environment
The text was updated successfully, but these errors were encountered: