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.

build says it failed at imported module, but app is still built and works.

See original GitHub issue

Complete noob in react, this is day 2 of my learning. but basically:

  1. i added tiny-relative-date to the app.
  2. i import like import relativeDate from 'tiny-relative-date';
  3. i run npm run build and then it says it failed, but the app still works in the browser.

output:

Garrett Morris@DESKTOP-U5VCBFV MINGW64 /e/blog
$ npm run build

> blog@0.1.0 build E:\blog
> react-scripts build

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

        ./node_modules/tiny-relative-date/src/factory.js:1

Read more here: http://bit.ly/2tRViJ9


npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! blog@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@0.1.0 build script 'react-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the blog package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs blog
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls blog
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\blog\npm-debug.log

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Nov 30, 2017

And herein lies the problem; this is the ES6 feature the bit.ly link mentions is not supported:

const calculateDelta = (now, date) => Math.round(Math.abs(now - date) / 1000)
1reaction
Timercommented, Nov 30, 2017

start and build are separate; try a different library! https://date-fns.org/v1.29.0/docs/distanceInWordsToNow

(and read the link provided in the error for reasoning)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular not importing a module in app.module.ts still gives ...
The error says, that app-bot-view-transfer-to-user is not registered in the corresponding auth-standalone module.
Read more >
How to Fix ModuleNotFoundError and ImportError
Photo by Leone Venter on unsplash.com. tl;dr. Use absolute imports; Append your project's root directory to PYTHONPATH — In any environment ...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
For resolving an imported module, Python checks places like the inbuilt library, installed modules, and modules in the current project. If it's ...
Read more >
Xcode 12.0.1 "No such module" | Apple Developer Forums
I have the same problem where I received the error "No module found" when ran on simulator, but works fine on mobile device....
Read more >
Documentation - Module Resolution - TypeScript
Finally, if the compiler could not resolve the module, it will log an error. In this case, the error would be something like...
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