question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run build doesn't work

See original GitHub issue

Hello!

I’m trying to debug what I think is a bug in @prismicio/client, but I can’t build to test my changes…

Versions

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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
adbutterfieldcommented, Aug 30, 2022

That works! Thanks!!!

I’ll open another issue when I’ve determined where the bug is.

0reactions
adbutterfieldcommented, Aug 31, 2022

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…

Read more comments on GitHub >

github_iconTop Results From Across the Web

`npm build` doesn't run the script named "build" in package.json
Unfortunately npm build is already an internal command, as described in the docs: This is the plumbing command called by npm link and...
Read more >
The command `npm run build` is not working since updating to ...
Hi there,. i've updated the sources to OJS 3.2 and the command npm run build mentioned in README.md returns with errors.
Read more >
npm run build not working - YouTube
Check-in package.json build script written or not then " / " give to style.css path. it will work.
Read more >
npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >
npm run build command fails - Salesforce Stack Exchange
I am trying to build the quip gdrive liveĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found