Search code examples
javascriptnode.jsdockerfilenext.jszeit-pkg

Next.js with pkg. Syntax requires enabling one of the following parser plugin(s): 'flow, typescript'


I use next.js with pkg in my project based on this tutorial but when I run pkg command I get an error:

> Error! This experimental syntax requires enabling
  one of the following parser plugin(s): 'flow, typescript' (13:7)

  /app/node_modules/ast-types-flow/lib/types.js

Pkg command:

pkg . -t node13-linux-x64 -o build

Pkg version: 4.4.8

I tried to add options but still doesn't work:

"pkg": {
  "assets": [".next/**/*"],
  "scripts": [".next/dist/**/*.js"],
  "options": ["experimental-modules"]
}

How to solve this issue?


Solution

  • I removed unnecessary packages and the problem is gone =| (react-scripts, storybook). Also options is not required