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.

Version 9.1.6 build error

See original GitHub issue

Bug report

upgraded next.js version from 9.1.4 to 9.1.6 and got a unknown: Unexpected token (7524:8) error. When I reversed to 9.1.4 the error was fixed

Describe the bug

got an error when I ran npm run build on version 9.1.6 of next.js when I reversed the version to 9.1.4 it was resolved. Also got this build error on zeit now

ailed to compile.

unknown: Unexpected token (7524:8)

> Build error occurred
Error: > Build failed because of webpack errors
    at build (/home/alabo/Documents/developers/kushnap/node_modules/next/dist/build/index.js:9:900)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kushnap@1.0.0 build: `next build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the kushnap@1.0.0 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!     /home/alabo/.npm/_logs/2019-12-27T23_00_58_197Z-debug.log

To Reproduce

  1. Upgrade next.js version to version 9.1.6. (I was on version 9.1.4)
  2. Run npm run build which will run next build script
  3. See error

Expected behavior

It is meant to build succesfully but it gave this error

Screenshots

Screenshot from 2019-12-28 00-42-40

System information

  • OS: elementary os 5.1
  • Version of Next.js: 9.1.6

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
anasalpurecommented, Sep 15, 2020

i think you must install webpack then retry to build your project npm install --save-dev webpack

2reactions
alabobriggscommented, Dec 30, 2019

Just incase anyone lands here in the future. The recommended fix provided by @Timer was to adjust the next.config.js as most of the modules there wasn’t being used. The config was trimed from


const withPlugins = require("next-compose-plugins");
const withCSS = require('@zeit/next-css')
const withBabelMinify = require('next-babel-minify')
const withProgressBar = require('next-progressbar')

const nextConfigs = {
    webpack: (config) => {
        // Fixes npm packages that depend on `fs` module
        config.node = {
            fs: "empty"
        };
        config.plugins = [
            ...config.plugins,
        ]
        return config;
    },
    target: 'serverless'
}

module.exports = withPlugins(
    [
        // plugin to import css
        withCSS({}),
        withBabelMinify(),
        withProgressBar({
            progressBar: {
                fancy: true
            }
        })
    ], 
    nextConfigs
);

to

module.exports = {
	experimental: { css: true },
}

NOTE: Experimantal above was added for some css features that are currently in development. Global css files linked in _document.js head was imported in app.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

PAN-OS 9.1.6 Known Issues - Palo Alto Networks
The following list includes all known issues that impact the PAN-OS® 9.1.6 release. This list includes both outstanding issues and issues ...
Read more >
Cisco ASA 9.1.6 Interim Build Release Notes
The software images listed below are Interim releases. They contain bug fixes which address specific issues found since the last Feature or Maintenance...
Read more >
TeamCity 9.1.6 (build 37459) Release Notes
Bug. TW-10090 - Build may be not stopped on disconnected agent (build runs until manually stopped); TW-41442 - I have builds in the...
Read more >
Cannot Evaluate DBVISUALIZER 9.1.6 - Getting the license ...
I have the error message below: Getting the license failed. Please check the . java.net.UnknownHostException: http://ipwsa105w04.africa.nedcor.net:9001/qaproxy.
Read more >
IBM® Datacap Version 9.1.6, Interim Fix 006 Readme file
Datacap Navigator when a session times out, users receive a HTTP 500 error instead of directing user to a logon page. IO28048, 195049 ......
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