-
-
Notifications
You must be signed in to change notification settings - Fork 41
🐛 PARSE_ERROR
on type export when building inside a pnpm script on github
#92
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
Comments
Interesting use-case. I'm thinking it doesn't work because pkgroll expects it to be executed when the CWD is the root of the project. Feel free to submit a PR! |
@privatenumber sure. i will check the actual cwd, but how would it affect ts vs js? it is also weird that it doesn't happen in other environments. |
Not sure—I was just speculating since I think that's a pretty big assumption I made when I was developing it. |
some findings:
|
This seems to happen as a result of the path in this scenario containing The order-dependent behavior here is likely due to the program cache in the plugin: ... i.e. if a file that imports the 'broken' module gets processed first, the compiler context contains an entry for the file with 'isExternalLibraryImport' set inside the TS compiler. When testing this, if instead of reusing the object containing the pkgroll/src/rollup/get-rollup-configs.ts Line 55 in 4ae9c67
... my project (which was affected by this, for it being a git module dependency as opposed to a published package) compiles fine. The plugin seems to have been changed in this regard since the last release, too - |
Problem
the issue only happens in a very specific case:
prepare
(repro: https://github.com/cruzdanilo/repro-pkgroll-lib)error:
seems like the file is being interpreted as javascript.
the error doesn't happen in multiple machines i tried (macos and linux)
Expected behavior
no error
Minimal reproduction URL
https://github.com/cruzdanilo/repro-pkgroll-ci/actions/runs/11057662251/job/30721965511
Version
v2.5.0
Node.js version
v22.9.0
Package manager
pnpm
Operating system
Linux
Bugs are expected to be fixed by those affected by it
Compensating engineering work financially will speed up resolution
The text was updated successfully, but these errors were encountered: