Closed Christian-Rau closed 3 years ago
Transferring this to the sapper-template repo. It probably makes sense to make the @rollup/plugin-replace
dependency be ^2.4.0
and add this option in rollup.config.js
.
i have the same error and don't know why it is rising. Waiting for solution
@didiermunezero the solution is posted directly above your comment. Add preventAssignment: true
to your rollup config.
It's also not an error, it's a warning, and does not stop you continuing unimpeded
I might add: I had trouble running npm, so i rolled back to earlier version. But will apply when upgrading. Cheers
Hent Outlook til Androidhttps://aka.ms/ghei36
From: Antony Jones notifications@github.com Sent: Friday, February 26, 2021 10:41:47 AM To: sveltejs/sapper-template sapper-template@noreply.github.com Cc: Christian Rau rauchristian@hotmail.com; Author author@noreply.github.com Subject: Re: [sveltejs/sapper-template] Bug: Rollup plugin-replace: preventAssignment set to "false" (#302)
@didiermunezerohttps://github.com/didiermunezero the solution is posted directly above your comment. Add preventAssignment: true to your rollup config.
It's also not an error, it's a warning, and does not stop you continuing unimpeded
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sveltejs/sapper-template/issues/302#issuecomment-786531846, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALVI6FXYQGUJGYTOIR4L3ODTA5UFXANCNFSM4YCT5NLQ.
@didiermunezero the solution is posted directly above your comment. Add
preventAssignment: true
to your rollup config.It's also not an error, it's a warning, and does not stop you continuing unimpeded
Yeah now it works, thank you. But why not make it true by default as you know that it will give a warning??
That's quite literally what the warning is telling you, that it will become the default in the next release.
But I'm not sure why you're commenting here - we aren't the authors of rollup-plugin-replace and as such have no part in the decision process.
oh that is cool and thanks! @antony
You need to insert preventAssignment: true, in all instances of replace, like this:
plugins: [
replace({
preventAssignment: true,
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode)
}),
Closed since it's not a bug, and the sapper template, has been updated.
You need to insert preventAssignment: true, in all instances of replace, like this:
plugins: [ replace({ preventAssignment: true, 'process.browser': true, 'process.env.NODE_ENV': JSON.stringify(mode) }),
Insert and still getting the same warning
So today I got this notification, and not sure what to do about it, as I don't see any preventAssignment anywhere.
• service worker @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to
true, as the next major version will default this option to true.
• server @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option totrue
, as the next major version will default this option to true. • client @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option totrue
, as the next major version will default this option to true. • service worker @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option totrue
, as the next major version will default this option to true. `