You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I declare const or function inside {@const} tag and it is already declared in <script> section, an error occurs in the rollup.
The compiler needs to check duplication or rename it automatically.
(I think it would be better to check for duplicates and give the appropriate error message to avoid confusion.)
rollup v2.60.0
bundles src/main.js → public/build/bundle.js...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src/App.svelte (9:19)
7: <p>{dummy_const(item)}</p>
8: {@const bar = array.map((item) => {9: const dummy_const = (item) => item * 2; ^10: return dummy_const(item);11: })}Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) at error (/Users/baseballyama/Desktop/git/svelte-contributes/svelte-general/my-app/node_modules/rollup/dist/shared/rollup.js:158:30) at Module.error (/Users/baseballyama/Desktop/git/svelte-contributes/svelte-general/my-app/node_modules/rollup/dist/shared/rollup.js:12382:16) at Module.tryParse (/Users/baseballyama/Desktop/git/svelte-contributes/svelte-general/my-app/node_modules/rollup/dist/shared/rollup.js:12785:25) at Module.setSource (/Users/baseballyama/Desktop/git/svelte-contributes/svelte-general/my-app/node_modules/rollup/dist/shared/rollup.js:12688:24) at ModuleLoader.addModuleSource (/Users/baseballyama/Desktop/git/svelte-contributes/svelte-general/my-app/node_modules/rollup/dist/shared/rollup.js:22152:20)
Describe the bug
If I declare
const
orfunction
inside{@const}
tag and it is already declared in<script>
section, an error occurs in the rollup.The compiler needs to check duplication or rename it automatically.
(I think it would be better to check for duplicates and give the appropriate error message to avoid confusion.)
Reproduction
https://svelte.dev/repl/10aee9db38db4ec5b5c4a3fac24045ae?version=3.46.4
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: