Skip to content
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

tsup no longer works with npm explore #1110

Open
ComLock opened this issue Apr 26, 2024 · 5 comments
Open

tsup no longer works with npm explore #1110

ComLock opened this issue Apr 26, 2024 · 5 comments

Comments

@ComLock
Copy link

ComLock commented Apr 26, 2024

This
https://github.com/enonic/starter-react4xp/blob/16a350485827d80be28aea384c3367d251edac5b/package.json#L94

Runs this:
https://github.com/enonic/npm-react4xp/blob/5911b76ea605c5595148390f6054dc11b781969c/package.json#L114

Which finally runs this:
https://github.com/enonic/npm-react4xp/blob/5911b76ea605c5595148390f6054dc11b781969c/package.json#L127

Which is:

npx tsup --config tsup.config.client.ts

Which will give this error:

npx tsup --config tsup.config.client.ts
✘ [ERROR] The entry point "/private/tmp/myproject/node_modules/@enonic/react4xp/tsup.config.client.ts" cannot be marked as external

Error: Build failed with 1 error:
error: The entry point "/private/tmp/myproject/node_modules/@enonic/react4xp/tsup.config.client.ts" cannot be marked as external
    at failureErrorWithLog (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:1651:15)
    at /private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:1059:25
    at runOnEndCallbacks (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:1486:45)
    at buildResponseToResult (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:1057:7)
    at /private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:1086:16
    at responseCallbacks.<computed> (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:704:9)
    at handleIncomingPacket (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:764:9)
    at Socket.readFromStdout (/private/tmp/myproject/node_modules/@enonic/react4xp/node_modules/esbuild/lib/main.js:680:7)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:559:12)

Editing tsup.config.client.ts changes nothing, it seem's it doesn't even attempt to read the file.

If I rename /private/tmp/myproject/node_modules to /private/tmp/myproject/whatever

Then cd /private/tmp/myproject/whatever/@enonic/react4xp/
I can run npm install
And now npx tsup --config tsup.config.client.ts works.

So it seems to mark everything under "node_modules" as external?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@ComLock
Copy link
Author

ComLock commented Apr 26, 2024

Might be related to evanw/esbuild#2382

@ComLock
Copy link
Author

ComLock commented Apr 26, 2024

Hmm, even downgrading to tsup 6.7.0 and esbuild 0.17.9 didn't help. Perhaps it's another module.

@ComLock
Copy link
Author

ComLock commented Apr 26, 2024

The externals change came in https://github.com/evanw/esbuild/releases/tag/v0.16.0, but even downgrading to 0.15.8 didn't help.

@ComLock
Copy link
Author

ComLock commented Apr 26, 2024

Ah, tsup had it's own copy of esbuild under node_modules/tsup/node_modules/esbuild.

I had to downgrade to tsup 6.5.0 so an old enough version of esbuild was used (0.15.8) then it worked.

So I guess the problem is in esbuild from version 0.16.0.

I guess this ticket should be moved to esbuild then?

@ComLock
Copy link
Author

ComLock commented Apr 29, 2024

egoist/bundle-require#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant