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
I'm trying to create an internal package in my urborepo project that uses pnpm as the package manager. The shared package follows the exact same setup as provided in the turborepo documentation, and it works as is in my vite frontend project. However, when importing that module to the backend (Nest + SWC using webpack) the dev script fails with SyntaxError: Unexpected token 'export'"
The built main.js file is trying to import from the shared package, which is only exporting interfaces and enums.
Things I've tried:
1. including it in webpack.config.js
(changing the exclude pattern of swc-loader
to include that folder from node_modules), like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create an internal package in my urborepo project that uses pnpm as the package manager. The shared package follows the exact same setup as provided in the turborepo documentation, and it works as is in my vite frontend project. However, when importing that module to the backend (Nest + SWC using webpack) the dev script fails with
SyntaxError: Unexpected token 'export'"
The built main.js file is trying to import from the shared package, which is only exporting interfaces and enums.
Things I've tried:
1. including it in webpack.config.js
(changing the exclude pattern of swc-loader
to include that folder from node_modules), like this:
2. Switching to npm
This DOES solve the issue which is why I am asking here in the pnpm discussions.
3. Setting shamefully-hoist=true in npmrc
This does not solve the issue
Beta Was this translation helpful? Give feedback.
All reactions