Closed JReinhold closed 1 year ago
This might not be an issue after all. After thinking about it and experimenting, it seems like the current CJS+ESM setup in a fresh SvelteKit+SB 6.5 project doesn't even work properly, it fails with similar CJS+ESM issues out of the gate.
And if the setup doesn't even work in a 6.5 project to begin with, I don't think anyone can expect that upgrading or automigrations works either. I think it's good to scope automigrations to actually only work on projects that already work.
Describe the bug
Recent changes to the automigration script architecture causes automigrations from fresh SvelteKit+Storybook 6.5 projects to fail with the following error:
A fresh Svelte+Storybook 6.5 project initialises with the following
main.cjs
:The
require("../svelte.config.js)
call imports the following ESM file (which I believe is valid to do):But
@sveltejs/adapter-auto
is ESM-only, so it only has the following export map: https://github.com/sveltejs/kit/blob/master/packages/adapter-auto/package.json#L12-L18I believe that causes the error.
Converting
main.cjs
to ESM makes the error go away (and moves you on the next error described in https://github.com/storybookjs/storybook/issues/21209):To Reproduce
System
No response
Additional context
No response