1

Here is the replication repo: https://github.com/stomvi/nextjs-postinstall-build

Just run:

npm i -g git+ssh://git@github.com:stomvi/nextjs-postinstall-build.git

I am using next.js as a local web server as a part of a cli tool. I would like to build the next.js server after the tool is installed, so I put next build in the postinstall script in the package.json. The installation failed with an "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file." error.

Using - next.js v9.0.4 - npm 6.9.0

The error shows that there might not be a jsx file loader for this. Local npm link works fine.

Failed to compile.

./pages/logs/[page].js 11:4
Module parse failed: Unexpected token (11:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
|   return (
>     <Layout>
|       <div className="card filter-container">
|         <div className="card-header">

> Build error occurred
Error: > Build failed because of webpack errors

How could I make this work? Currently I just commit the .next dir into the repo.

0 Answers0