Yarn monorepo - trying to import a js file with export statements says export is reserved #15941
Replies: 3 comments 1 reply
-
@Madd0g Hi, can you explain how you solved this? I've followed the vide docs about bundling linked dependencies, but still fails, probably I don't understand how to set up. |
Beta Was this translation helpful? Give feedback.
-
@Madd0g Thanks... I'll wait to see if someone reads this post and enlightens me... |
Beta Was this translation helpful? Give feedback.
-
I've solved the problem: adding the backend (the shared package) scope path to the For example, if the backend (or shared library) is named dependencies: {
"@my-scope/backend": "workspace:*"
} And add the scope to the build: {
alias: {
'@my-scope': path.resolve(__dirname, '../')
}
} In this case, To import any file from the backend in the Quasar, use scope: import type { MyType } from '@my-scope/backend/src/myfile' |
Beta Was this translation helpful? Give feedback.
-
I have a bunch of packages in my monorepo - I have a shared package that is shared between client and server. In the shared package I have both
exports
andtypes
in package.json.When I try to import that in my quasar project, I get the error that "export is a reserved keyword".
Does that mean that for quasar I need to package as commonjs or something? I tried that and it breaks my server, which uses that package without issue.
Any advice for me? I saw lots of discussions about supporting ESM in the quasar config, but couldn't find people talking about these problems with dependencies.
EDIT: found the answer here for bundling linked dependencies in the vite docs site
Thanks
Beta Was this translation helpful? Give feedback.
All reactions