npm run build doesn't work
See original GitHub issueHello!
Iām trying to debug what I think is a bug in @prismicio/client, but I canāt build to test my changesā¦
Versions
- @prismicio/client: 6.7.0
- node: 16.15.1
Reproduction
run npm run build
Additional Details
Here is the log I get:
@prismicio/client@6.7.0 build
> siroc build
ā¹ Beginning build @prismicio/client 16:36:12 ā Built @prismicio/client index.d.ts 5.0 kB @prismicio/client 16:36:16
ERROR [PARSE_ERROR] Unexpected token (Note that you need plugins to import files that are not JavaScript) at /Users/adam.a.butterfield/projects/myaxa-web/node_modules/@prismicio/client/src/index.ts:40:7
at src/index.ts:40:7 at error (node_modules/rollup/dist/shared/rollup.js:198:30) at Module.error (node_modules/rollup/dist/shared/rollup.js:12560:16) at Module.tryParse (node_modules/rollup/dist/shared/rollup.js:12937:25) at Module.setSource (node_modules/rollup/dist/shared/rollup.js:12842:24) at ModuleLoader.addModuleSource (node_modules/rollup/dist/shared/rollup.js:22284:20)
ERROR [PARSE_ERROR] Unexpected token (Note that you need plugins to import files that are not JavaScript) at /Users/adam.a.butterfield/projects/myaxa-web/node_modules/@prismicio/client/src/index.ts:40:7
at src/index.ts:40:7 at error (node_modules/rollup/dist/shared/rollup.js:198:30) at Module.error (node_modules/rollup/dist/shared/rollup.js:12560:16) at Module.tryParse (node_modules/rollup/dist/shared/rollup.js:12937:25) at Module.setSource (node_modules/rollup/dist/shared/rollup.js:12842:24) at ModuleLoader.addModuleSource (node_modules/rollup/dist/shared/rollup.js:22284:20)
ERROR undefined 16:36:16
ERROR undefined 16:36:16
ā Finished building in 4.0s @prismicio/client 16:36:16
For convenience, line 40 is:
export type { CreateClient, ClientConfig } from "./client";
Looks like it doesnāt like āexport typeā.
Steps to reproduce
run npm run build
What is expected?
Build not to fail.
What is actually happening?
Build is failingā¦
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
That works! Thanks!!!
Iāll open another issue when Iāve determined where the bug is.
I found a few issues in the node-fetch repo that smell like my issue: https://github.com/node-fetch/node-fetch/issues/137 https://github.com/node-fetch/node-fetch/issues/665 So next step is to figure out exactly why itās failing. Right not it seems quite random.
Edit: I found the issue. Looks like itās been fixed in node-fetch v3, which I havenāt upgraded to yet, because of it being esm onlyā¦