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.

next build wont work after updating from next@9.5.3 to next@9.5.4

See original GitHub issue

Bug report

Describe the bug

The command next build fails on next@9.5.4 but works fine in next@9.5.3. The error log is the following:

$ next build
Loaded env from /home/aalonso/workspaces/aalonso.dev/.env.local
info  - Using external babel configuration from /home/aalonso/workspaces/aalonso.dev/.babelrc
info  - Creating an optimized production build  
Failed to compile.

./src/containers/Cover/Cover.module.scss
Error: Can't resolve '/images/cover.webp' in '/home/aalonso/workspaces/aalonso.dev/src/containers/Cover'
    at runMicrotasks (<anonymous>)


> Build error occurred
Error: > Build failed because of webpack errors
    at build (/home/aalonso/workspaces/aalonso.dev/node_modules/next/dist/build/index.js:15:918)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This happens when resolving an image URL from SCSS. The SCSS (./src/containers/Cover/Cover.module.scss):

.container {
  ...
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/images/cover.webp');
  ...
}

The folders structure of the repository:

./
|- package.json
|- .babelrc
|   ...
|- src/
   |- containers/
      |- Cover/
         |- Cover.module.scss
|- public/
   |- images/
      |- cover.webp

.babelrc

{
  "presets": ["next/babel"],
  "plugins": []
}

To Reproduce

Just run next build on this branch of this public repository: https://github.com/tairosonloa/aalonso.dev/tree/dependabot/npm_and_yarn/next-9.5.4 NOTE: if you run yarn build or npm run build, process will throw if you don’t set the env variable DOMAIN, as it tries to execute also the npm prebuild command, which requires the env variable to be set. To fix it, just run export DOMAIN=aalonso.dev on your terminal.

Here is the GitHub actions log with the failing build stage: https://github.com/tairosonloa/aalonso.dev/pull/115/checks?check_run_id=1230832954

Here is the GitHub actions log passing build step for the previous commit (before the next dependency update): https://github.com/tairosonloa/aalonso.dev/runs/1230831205?check_suite_focus=true

Expected behavior

The build process should resolve the image path and finish without errors, like in the previous build processes.

System information

  • OS: Ubuntu-Latest (GitHub Actions and WSL)
  • Version of Next.js: 9.5.4
  • Version of Node.js: v12.X (GitHub Actions) and v12.19.0 (WSL)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tairosonloacommented, Oct 9, 2020

I’m sorry, as issue #17701 was closed I didn’t see it was a duplicated. Best regards

0reactions
balazsorban44commented, Jan 29, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >
Construction Inflation 2022 – Tables Plots updated 12-10-22
When the activity level is low, contractors are all competing for a smaller amount of work and therefore they may reduce margins in...
Read more >
Alameda County Express Lanes Work Plan for the I-680 Sunol ...
Mid-Range (next 9-24 months). 2.2 Complete traffic study (related to. Strategy 2.1). 2.3 Work with Caltrans to identify operational improvements, including.
Read more >
Build error when compiling Next.js app using next-pwa
0 . This plugin function signature has been changed to follow the recommended pattern from next.js . Mainly extracting pwa config from mixing ......
Read more >
Transportation Programming Guidebook - Southwest Washington ...
Americans with Disabilities Act (ADA) Information ... be a working document that can be updated as needed. ... Build bicycle and pedestrian projects....
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