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.

Not able to successfully build polyfill-service

See original GitHub issue

Not able to successfully build polyfill-service. Hi, The instructions mentioned in CONTRIBUTING.md was followed:

$ git clone https://github.com/Financial-Times/polyfill-service.git
$ cd polyfill-service
$ npm ci
$ npm run build # build the assets for the website
$ npm start # start a server on localhost:8080

But whenever I am building the application and executing the second last step i.e. “npm run build” I am getting error. The npm log is attached below:

/opt/polyfill-service# npm run build

polyfill-service@4.28.1 build /opt/polyfill-service run-s clean eleventy build:*

polyfill-service@4.28.1 clean /opt/polyfill-service rimraf ./dist ./.cache

polyfill-service@4.28.1 eleventy /opt/polyfill-service eleventy

Problem writing Eleventy templates: (more in DEBUG output)

Having trouble rendering 11ty.js template ./src/assets/v3/library.11ty.js

TemplateContentRenderError was thrown

ENOENT: no such file or directory, open ‘/opt/polyfill-service/node_modules/polyfill-library-3.27.4/polyfills/__dist/aliases.json’

Error was thrown: Error: ENOENT: no such file or directory, open ‘/opt/polyfill-service/node_modules/polyfill-library-3.27.4/polyfills/__dist/aliases.json’ Benchmark (Data): ./src/data/polyfills.js took 575ms (51.9%) Using pathPrefix: /v3 Copied 9 files / Wrote 0 files in 0.91 seconds (v0.11.0) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! polyfill-service@4.28.1 eleventy: eleventy npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the polyfill-service@4.28.1 eleventy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-07-14T17_39_41_666Z-debug.log ERROR: “eleventy” exited with 1. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! polyfill-service@4.28.1 build: run-s clean eleventy build:* npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the polyfill-service@4.28.1 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-07-14T17_39_41_701Z-debug.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
JakeChampioncommented, Jul 15, 2020

I can confirm that if you were running as root, npm set unsafe-perm true resolves the issue:

root@49f288e17efe:~/polyfill-service# npm set unsafe-perm true
root@49f288e17efe:~/polyfill-service# npm ci
added 1885 packages in 1277.9s
root@49f288e17efe:~/polyfill-service# npm run build

> polyfill-service@4.28.1 build /root/polyfill-service
> run-s clean eleventy build:*


> polyfill-service@4.28.1 clean /root/polyfill-service
> rimraf ./dist ./.cache


> polyfill-service@4.28.1 eleventy /root/polyfill-service
> eleventy

Writing ./dist/v3/json/library-3.27.4.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.28.1.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.34.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.35.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.36.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.37.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.38.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.39.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.40.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.41.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.42.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.43.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.44.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.45.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.46.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.48.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.49.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.50.2.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.51.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.52.0.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.52.1.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/json/library-3.52.2.json from ./src/assets/v3/library.11ty.js.
Writing ./dist/v3/api/index.html from ./src/assets/v3/api.njk.
Writing ./dist/v3/report-a-bug/index.html from ./src/assets/v3/report-a-bug.njk.
Writing ./dist/v3/security-policy/index.html from ./src/assets/v3/security-policy.njk.
Writing ./dist/v3/index.html from ./src/assets/v3/index.njk.
Writing ./dist/v3/privacy-policy/index.html from ./src/assets/v3/privacy-policy.njk.
Writing ./dist/v3/supported-browsers/index.html from ./src/assets/v3/supported-browsers.njk.
Writing ./dist/v3/terms/index.html from ./src/assets/v3/terms.njk.
Writing ./dist/v3/url-builder/index.html from ./src/assets/v3/url-builder.njk.
Writing ./dist/v3/packages/index.html from ./src/assets/v3/packages.njk.
Benchmark (Data): `./src/data/polyfills.js` took 2643ms (8.5%)
Using pathPrefix: /v3
Copied 9 files / Wrote 31 files in 30.11 seconds (971.3ms each, v0.11.0)
> polyfill-service@4.28.1 build:js /root/polyfill-service
> mkdir -p dist/js && esbuild src/assets/js/index.js --bundle --minify > dist/js/index.min.js

root@49f288e17efe:~/polyfill-service# npm start

> polyfill-service@4.28.1 start /root/polyfill-service
> ./start_server.sh server/index.js
Warning: metrics are not being recorded for this application. Please provide a FT_GRAPHITE_APP_UUID environment variable
Warning: errors are not being logged to Sentry for this application. Please provide a SENTRY_DSN environment variable
polyfill-service configured (graphite=false logging=true sentry=false)
polyfill-service started (env=development port=8080)
1reaction
JakeChampioncommented, Jul 15, 2020

@aniket-gangadharan Are you running npm ci as the root user? If so npm will not run postinstall scripts unless you set unsafe-perm to true like so – npm set unsafe-perm true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

issue with polyfill in vite build output #7384 - GitHub
Describe the bug​​ during my exploration with @toruslabs/openlogin sdk, i find out that using vite. js gives a different result between dev and...
Read more >
How to Polyfill node core modules in webpack 5
This was resolved simply by installing the buffer package with npm install -D buffer . 'fs'. Module not found: Error: Can't resolve 'fs ......
Read more >
Loading Polyfills Only When Needed - Philip Walton
The solution to this problem is to only load polyfills when they're needed, but as it turns out, in practice that's a lot...
Read more >
Update to 3.0 breaks component tests - headers-polyfill/lib
Patch Release This releases fixes the Cannot find module 'headers-polyfill/lib' error seen when using mock service worker (MSW) in tests or ...
Read more >
What is a polyfill - Kent C. Dodds
A polyfill is code which will make the currently running JavaScript environment support features which it does not.
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