-
Notifications
You must be signed in to change notification settings - Fork 86
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
export declarations may only appear at top level of a module #349
Comments
Is there a stack trace? It's a little hard to troubleshoot without knowing the origin and I haven't seen the error before. |
There unfortunately isn't a stack trace. No exceptions are raised by the server and the only error is in the client-side JavaScript. The error points to the I think this issue may not be with Routify itself but that there might just be some part missing from the documentation on adding Routify to an existing project. Or I'm just misunderstanding something that is already documented. I am also able to reproduce this error by simply cloning the Svelte template project and changing the Rollup Please let me know if there is more information you need to assist or if you think this issue is inappropriate here and should be raised elsewhere. |
If Jest can't handle ESM code you need to set |
Sorry for the confusion but I'm not following what this has to do with Jest. |
I've discovered the issue is related to how the script is being loaded and I've opened the following PR on the docs to hopefully help anyone else in the future. |
I'm facing an issue that seems very similar to #328 however it is occurring at runtime. I'm trying to add Routify to an existing application and getting the following error:
Firefox
Uncaught SyntaxError: export declarations may only appear at top level of a module
Brave
Uncaught SyntaxError: Unexpected token 'export'
I've gone through the documentation and changed my rollup.config.js
output.format
toesm
as well as usingoutput.dir
instead ofoutput.file
.I also found this similar issue in Sapper repo but it was closed without any comment/resolution.
app.ts
App.svelte
rollup.config.js
The text was updated successfully, but these errors were encountered: