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 attempting to implement magic-regexp in the project https://github.com/sapphiredev/utilities (draft PR: sapphiredev/utilities#755), however, for some unknown reason the esbuild plugin is giving me compiler errors. Sadly I cannot manage to reproduce the issue in a clean project so it's somehow something very specific with our project. Even if I use the exact same tsup options in a clean project, the issues does not show up in such a project.
The error I currently get is:
X [ERROR] Unexpected token (9:29) [plugin MagicRegExpTransformPlugin]
This error came from the "onLoad" callback registered here:
../../node_modules/esbuild/lib/main.js:1340:8:
X 1340 │ [ERRORawait promise;
╵ ]^
at setupPlugins (file:///F:/sapphiredev/utilities/node_modules/unplugin/dist/index.mjs:995:16)
at async handlePlugins (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1340:9)
Unexpected token (9:29) [plugin MagicRegExpTransformPlugin]
This error came from the "onLoad" callback registered here:
../../node_modules/esbuild/lib/main.js:1340:8:
1340 │ await promise;
╵ ^
at setupPlugins (file:///F:/sapphiredev/utilities/node_modules/unplugin/dist/index.mjs:995:16)
at async handlePlugins (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1340:9)
IIFE dist\iife\index.global.js 29.93 KB
IIFE dist\iife\index.global.js.map 70.50 KB
IIFE ⚡️ Build success in 188ms
CJS Build failed
Error: Build failed with 1 error:
error: Unexpected token (9:29)
at failureErrorWithLog (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1651:15)
at F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1059:25
at runOnEndCallbacks (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1486:45)
at buildResponseToResult (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1057:7)
at F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:1086:16
at responseCallbacks.<computed> (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:704:9)
at handleIncomingPacket (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:764:9)
at Socket.readFromStdout (F:\sapphiredev\utilities\node_modules\esbuild\lib\main.js:680:7)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
ESM Build failed
I have linked the draft PR with the WIP branch below as opposed to a stackblitz because the issue is very specific to our project it seems.
To reproduce:
Clone the repository
Check out the proper branch
Run yarn install to install dependencies
Build the package that packages/utilities depends on with:
yarn turbo run build --filter "@sapphire/node-utilities" --filter "@sapphire/eslint-config" --filter "@sapphire/prettier-config"
🐛 The bug
I'm attempting to implement magic-regexp in the project https://github.com/sapphiredev/utilities (draft PR: sapphiredev/utilities#755), however, for some unknown reason the esbuild plugin is giving me compiler errors. Sadly I cannot manage to reproduce the issue in a clean project so it's somehow something very specific with our project. Even if I use the exact same tsup options in a clean project, the issues does not show up in such a project.
The error I currently get is:
I have linked the draft PR with the WIP branch below as opposed to a stackblitz because the issue is very specific to our project it seems.
To reproduce:
yarn install
to install dependenciespackages/utilities
depends on with:packages/utilites
yarn build
🛠️ To reproduce
sapphiredev/utilities#755
🌈 Expected behaviour
I am able to build my code correctly using tsup with the esbuild plugin
ℹ️ Additional context
No response
The text was updated successfully, but these errors were encountered: