rixo / svelte-template-hot

Copy of official Svelte template with added HMR support
61 stars 9 forks source link

TypeError: Cannot read property 'length' of undefined w/ @rollup/plugin-commonjs v16 #16

Open frederikhors opened 4 years ago

frederikhors commented 4 years ago

From "@rollup/plugin-commonjs": "16.0.0" this is the error:

[Nollup] Listening on http://localhost:5000
TypeError: Cannot read property 'length' of undefined
    at new MagicString (C:\svelte\node_modules\magic-string\dist\magic-string.cjs.js:354:34)
    at module.exports (C:\svelte\node_modules\nollup\lib\impl\ImportExportResolver.js:318:21)
    at compileModule (C:\svelte\node_modules\nollup\lib\impl\NollupCompiler.js:59:30)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async compileInputTarget (C:\svelte\node_modules\nollup\lib\impl\NollupCompiler.js:138:5)
    at async Object.compile (C:\svelte\node_modules\nollup\lib\impl\NollupCompiler.js:211:31)
    at async generateImpl (C:\svelte\node_modules\nollup\lib\index.js:13:21)

Reproduction here: https://github.com/frederikhors/svelte-template-hot/tree/update-commonjs-to-16

rixo commented 4 years ago

OK thanks (for all your help around here, it's really appreciated & valuable). I'll investigate that.

rixo commented 3 years ago

Confirmed on my side. This is between Nollup and @rollup/plugin-commonjs. I think the issue should be reported at Nollup, 'cause he's probably in the best position to understand what's going on.

I'm pinning @rollup/plugin-commonjs@15 in the template for now.

frederikhors commented 3 years ago

Are you opening the issue on nollup describing what you think? Do you want?

rixo commented 3 years ago

I'll do it eventually, but I'm swamped these days :sweat: Go for it if you can ;)

frederikhors commented 3 years ago

Done.

frederikhors commented 3 years ago

Fixed in nollup 0.14.0.

rixo commented 3 years ago

We should probably bump to last versions of Nollup and the commonjs plugin in the template now that this is fixed, before closing this issue.