Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin sends error flood when using very custom build command #533

Closed
rayriffy opened this issue Jul 15, 2021 · 6 comments
Closed

Plugin sends error flood when using very custom build command #533

rayriffy opened this issue Jul 15, 2021 · 6 comments
Labels
priority: medium type: bug code to address defects in shipped code

Comments

@rayriffy
Copy link

Describe the bug

I am building Next application with Nx monorepo to Netlify with heavily customized command. next-plugin-netlify cannot recognize those and send false-positive double error flood to deploy log on onPreBuild, onBuild, and onPostBuild lifecycle. But NextJS still being detected and deploy correctly

CleanShot 2021-07-16 at 00 41 38
CleanShot 2021-07-16 at 00 42 12
CleanShot 2021-07-16 at 00 42 26

Expected behavior

Error flood should not be visible

Versions

  • Next.js: 11.0.1

If you're using file-based installation

  • netlify.toml:
@norbertschuler
Copy link

norbertschuler commented Jul 15, 2021

We are getting the same error using Next.js 10.2.3 having this command within our netlify.toml file - we also have the same command in our deploy settings.

[build]
  command = "npm run build && npm run export"
  publish = "out"

Context of the build.

7:01:11 PM: ❯ Version
7:01:11 PM:   @netlify/build 15.11.5
7:01:11 PM: ​
7:01:11 PM: ❯ Flags
7:01:11 PM:   deployId: 60f069861f89db2565832087
7:01:11 PM: ​
7:01:11 PM: ❯ Current directory
7:01:11 PM:   /opt/build/repo
7:01:11 PM: ​
7:01:11 PM: ❯ Config file
7:01:11 PM:   /opt/build/repo/netlify.toml
7:01:11 PM: ​
7:01:11 PM: ❯ Context
7:01:11 PM:   production
7:01:11 PM: ​
7:01:11 PM: ❯ Installing plugins
7:01:11 PM:    - @netlify/[email protected]
7:01:11 PM:    - [email protected]
7:01:11 PM:    - [email protected]
7:01:39 PM: ​
7:01:39 PM: ❯ Loading plugins
7:01:39 PM:    - @netlify/[email protected] from Netlify app
7:01:39 PM:    - [email protected] from netlify.toml
7:01:39 PM:    - [email protected] from netlify.toml

We currently have a problem not building anymore without changing our sources with the following error:

7:01:42 PM: 
7:01:42 PM:   3. build.command from netlify.toml                            
7:01:42 PM: 
7:01:42 PM: ​
7:01:42 PM: $ npm run build && npm run export
7:01:42 PM: > [email protected] build /opt/build/repo
7:01:42 PM: > next build
...
7:04:41 PM: Failed to compile.
7:04:41 PM: 
7:04:41 PM: ModuleNotFoundError: Module not found: Error: Can't resolve 'asciify-image' in '/opt/build/repo/node_modules/probe.gl/dist/es5/lib'
7:04:41 PM: > Build error occurred
7:04:41 PM: Error: > Build failed because of webpack errors
7:04:41 PM:     at /opt/build/repo/node_modules/next/dist/build/index.js:17:924
7:04:41 PM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:6:584)
7:04:41 PM: npm ERR! code ELIFECYCLE
7:04:41 PM: npm ERR! errno 1
7:04:41 PM: npm ERR! [email protected] build: `next build`
7:04:41 PM: npm ERR! Exit status 1
7:04:41 PM: npm ERR!
7:04:41 PM: npm ERR! Failed at the [email protected] build script.
7:04:41 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
7:04:41 PM: npm ERR! A complete log of this run can be found in:
7:04:41 PM: npm ERR!     /opt/buildhome/.npm/_logs/2021-07-15T17_04_41_542Z-debug.log

@lindsaylevine lindsaylevine added priority: medium type: bug code to address defects in shipped code labels Jul 16, 2021
@lindsaylevine
Copy link

@rayriffy hey ray! thanks for reporting :). i haven't had the opportunity to work much on next recently so i defer to @ascorbic who's done all the awesome monorepo support work and has been juggling a ton of other major next.js initiatives. he should be able to offer insight into these floods and maybe patch it up for you.

@norbertschuler hey norbert! it seems like that second error you shared might actually be different from the parseNpmScript errors but still related to the script work since it does seem like a random, pure next build error (and not a plugin-specific error). i'll defer to matt (@ascorbic) again but perhaps a separate issue may be necessary!

@ascorbic
Copy link
Contributor

Hey. Thanks for the report. This looks like the same issue as #528, and should be fixed in version 3.7.1 of the plugin. It will be auto-installed later today, but if you want to use it now, install @netlify/plugin-nextjs@latest. Closing as duplicate of #528, but please do comment to say whether 3.7.1 fixes it for you

@norbertschuler
Copy link

Netlify now is using @netlify/[email protected] and our builds are working again :-)

@ascorbic
Copy link
Contributor

Great! Thanks for the update.

@rayriffy
Copy link
Author

@ascorbic i still have an error throw from @netlify/[email protected], but now in more detail.

CleanShot 2021-07-20 at 00 45 12

CleanShot 2021-07-20 at 00 46 57

serhalp pushed a commit that referenced this issue Jun 13, 2024
…ferred downstream (#533)

* fix: ensure locale is in next request to allow page locale to be calculated downstream

* test: Add checks for nextRequest locale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

4 participants