Parcel build failed: No import() polyfill available


This article goes over how to fix the Parcel build error:

No import() polyfill available for context 'node'

Problem

If you got the Parcel build error:

parcel build
🚨 Build failed.

@parcel/runtime-js: No import() polyfill available for context 'node'

  Error: No import() polyfill available for context 'node'
  at nullthrows

This might mean you’re missing a browserslist config.

Solution

Add browserslist field to package.json:

{
  "browserslist": [
    "last 1 chrome version",
    "last 1 firefox version",
    "last 1 safari version"
  ]
}

Or add it to .browserslistrc:

touch .browserslistrc
last 1 chrome version
last 1 firefox version
last 1 safari version


Please support this site and join our Discord!