-
Notifications
You must be signed in to change notification settings - Fork 86
10.0.8 breaks plugin (can't read config target) #104
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
Comments
@laugharn hey dan! this seems like possibly a monorepo-specific problem? unfortunately i'm not able to repro off this info alone :(. are you able to open a simple [mono]repo that imitates your general setup/dir structure and repros this error? 🙏 |
Hi @lindsaylevine, I've done a little bit more work and this appears to be a 10.0.8-canary issue, it builds correctly with 10.0.7 I'm doing the exploration at https://github.com/bungalohomes/exp building the main directory. I'm not sure how much access you have at Netlify but I can point you to some of our deployments/logs. |
|
just checked, this is an issue for more than just monorepos. digging in now. |
Similar, I had to upgrade to Next |
@segheysens thanks stephen!! working on it!! requires a big refactor 😅 |
I think I ran into a similar problem today with deploying next js 10.0.8. Nice work jumping on it so quickly! |
fixed and released in v3.0.0! |
yay thats awesome I just tried it and it worked! I uninstalled and reinstalled the plugin to get the latest version not sure if required or not. |
@brenelz if you had the plugin installed at a fixed version before, then you'd need to reinstall :) otherwise it should run on the latest! |
I still get the same message using next 10.0.7 and @netlify/[email protected] 😕 |
@tgrassl have you tried updating next to 10.0.8? That's the topic of this issue and 10.0.8 with the 3.x upgrade on the Netlify plugin works for me |
@segheysens yes, but it's still the same |
@tgrassl could you attach your project or a sample project exhibiting this behavior for debugging? |
@segheysens Sure, here's a dummy project (https://github.com/tgrassl/nextjs-netlify-test) and the corresponding build log from Netlify. Did not configure anything else besides installing the Essential Next.js plugin from the UI
|
hey! timon, since you already have a next config, the plugin does not and cannot attempt to modify it for you. you need to manually update your config to include target: serverless. this is expected behavior of the plugin and unrelated to the 10.0.8 bug :).
…Sent from my iPhone
On Mar 14, 2021, at 6:35 PM, Timon Grassl ***@***.***> wrote:
@segheysens Sure, here's a dummy project (https://github.com/tgrassl/nextjs-netlify-test) and the corresponding build log from Netlify. Did not configure anything else besides installing the Essential Next.js plugin from the UI
11:27:38 PM: Build ready to start
11:27:40 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
11:27:40 PM: build-image tag: v3.7.0
11:27:40 PM: buildbot version: c469f7ab4d394d961ca036b1163fdbb6ef9fb78c
11:27:40 PM: Building without cache
11:27:40 PM: Starting to prepare the repo for build
11:27:40 PM: No cached dependencies found. Cloning fresh repo
11:27:40 PM: git clone https://github.com/tgrassl/nextjs-netlify-test
11:27:42 PM: Preparing Git Reference refs/heads/main
11:27:43 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'out' versus 'out/' in the Netlify UI
11:27:43 PM: Starting build script
11:27:43 PM: Installing dependencies
11:27:43 PM: Python version set to 2.7
11:27:45 PM: v12.18.0 is already installed.
11:27:45 PM: Now using node v12.18.0 (npm v6.14.4)
11:27:45 PM: Started restoring cached build plugins
11:27:45 PM: Finished restoring cached build plugins
11:27:46 PM: Attempting ruby version 2.7.1, read from environment
11:27:47 PM: Using ruby version 2.7.1
11:27:48 PM: Using PHP version 5.6
11:27:48 PM: Started restoring cached node modules
11:27:48 PM: Finished restoring cached node modules
11:27:48 PM: Installing NPM modules using NPM version 6.14.4
11:27:56 PM: > ***@***.*** postinstall /opt/build/repo/node_modules/core-js
11:27:56 PM: > node -e "try{require('./postinstall')}catch(e){}"
11:27:56 PM: npm WARN ***@***.*** No description
11:27:56 PM: npm WARN ***@***.*** No repository field.
11:27:56 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ***@***.*** (node_modules/fsevents):
11:27:56 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for ***@***.***: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:27:56 PM: added 251 packages from 251 contributors and audited 253 packages in 7.411s
11:27:56 PM: 16 packages are looking for funding
11:27:56 PM: run `npm fund` for details
11:27:56 PM: found 0 vulnerabilities
11:27:56 PM: NPM modules installed
11:27:57 PM: Started restoring cached go cache
11:27:57 PM: Finished restoring cached go cache
11:27:57 PM: go version go1.14.4 linux/amd64
11:27:57 PM: go version go1.14.4 linux/amd64
11:27:57 PM: Installing missing commands
11:27:57 PM: Verify run directory
11:27:59 PM:
11:27:59 PM: ────────────────────────────────────────────────────────────────
11:27:59 PM: Netlify Build
11:27:59 PM: ────────────────────────────────────────────────────────────────
11:27:59 PM:
11:27:59 PM: ❯ Version
11:27:59 PM: @netlify/build 9.9.5
11:27:59 PM:
11:27:59 PM: ❯ Flags
11:27:59 PM: apiHost: api.netlify.com
11:27:59 PM: cacheDir: /opt/build/cache
11:27:59 PM: deployId: 604e8ddaa9112ef8d84f9f3e
11:27:59 PM: mode: buildbot
11:27:59 PM: testOpts:
11:27:59 PM: silentLingeringProcesses: ''
11:27:59 PM:
11:27:59 PM: ❯ Current directory
11:27:59 PM: /opt/build/repo
11:27:59 PM:
11:27:59 PM: ❯ Config file
11:27:59 PM: No config file was defined: using default values.
11:27:59 PM:
11:27:59 PM: ❯ Context
11:27:59 PM: production
11:27:59 PM:
11:27:59 PM: ❯ Installing plugins
11:27:59 PM: - @***@***.***
11:28:20 PM:
11:28:20 PM: ❯ Loading plugins
11:28:20 PM: - @***@***.*** from Netlify app
11:28:20 PM:
11:28:20 PM: ────────────────────────────────────────────────────────────────
11:28:20 PM: 1. onPreBuild command from @netlify/plugin-nextjs
11:28:20 PM: ────────────────────────────────────────────────────────────────
11:28:20 PM:
11:28:21 PM: Your next.config.js must set the "target" property to one of: serverless, experimental-serverless-trace. Update the
11:28:21 PM: target property to allow this plugin to run.
11:28:21 PM:
11:28:21 PM: ***@***.***/plugin-nextjs onPreBuild completed in 828ms)
11:28:21 PM:
11:28:21 PM: ────────────────────────────────────────────────────────────────
11:28:21 PM: 2. Build command from Netlify app
11:28:21 PM: ────────────────────────────────────────────────────────────────
11:28:21 PM:
11:28:21 PM: $ npm run build
11:28:22 PM: > ***@***.*** build /opt/build/repo
11:28:22 PM: > next build
11:28:23 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache
11:28:23 PM: info - Creating an optimized production build...
11:28:43 PM: info - Compiled successfully
11:28:43 PM: info - Collecting page data...
11:28:44 PM: info - Generating static pages (0/10)
11:28:46 PM: info - Generating static pages (2/10)
11:28:46 PM: info - Generating static pages (4/10)
11:28:46 PM: info - Generating static pages (7/10)
11:28:46 PM: info - Generating static pages (10/10)
11:28:46 PM: info - Finalizing page optimization...
11:28:46 PM: Page Size First Load JS
11:28:46 PM: ┌ ● / 472 B 84 kB
11:28:46 PM: ├ /_app 0 B 79.8 kB
11:28:46 PM: ├ ○ /404 2.72 kB 82.5 kB
11:28:46 PM: └ ● /second-page 395 B 83.9 kB
11:28:46 PM: + First Load JS shared by all 79.8 kB
11:28:46 PM: ├ chunks/08b56c1779dbdbb0e3e8dbde9a3df2a9ca8dae00.da1aa7.js 16 kB
11:28:46 PM: ├ chunks/commons.5e5c3a.js 14.4 kB
11:28:46 PM: ├ chunks/framework.9d5241.js 41.8 kB
11:28:46 PM: ├ chunks/main.31e598.js 6.39 kB
11:28:46 PM: ├ chunks/pages/_app.fb42d0.js 496 B
11:28:46 PM: └ chunks/webpack.50bee0.js 751 B
11:28:46 PM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
11:28:46 PM: ○ (Static) automatically rendered as static HTML (uses no initial props)
11:28:46 PM: ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
11:28:46 PM: (ISR) incremental static regeneration (uses revalidate in getStaticProps)
11:28:46 PM:
11:28:46 PM: (build.command completed in 25.1s)
11:28:46 PM:
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM: 3. onBuild command from @netlify/plugin-nextjs
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM:
11:28:46 PM: Your next.config.js must set the "target" property to one of: serverless, experimental-serverless-trace. Update the
11:28:46 PM: target property to allow this plugin to run.
11:28:46 PM:
11:28:46 PM: ***@***.***/plugin-nextjs onBuild completed in 5ms)
11:28:46 PM:
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM: 4. Deploy site
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM:
11:28:46 PM:
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM: Configuration error
11:28:46 PM: ────────────────────────────────────────────────────────────────
11:28:46 PM:
11:28:46 PM: Error message
11:28:46 PM: Deploy did not succeed: Deploy directory 'out' does not exist
11:28:46 PM:
11:28:46 PM: Resolved config
11:28:46 PM: build:
11:28:46 PM: command: npm run build
11:28:46 PM: commandOrigin: ui
11:28:46 PM: publish: /opt/build/repo/out
11:28:46 PM: plugins:
11:28:46 PM: - inputs: {}
11:28:46 PM: origin: ui
11:28:46 PM: package: ***@***.***/plugin-nextjs'
11:28:47 PM: Caching artifacts
11:28:47 PM: Started saving node modules
11:28:47 PM: Finished saving node modules
11:28:47 PM: Started saving build plugins
11:28:47 PM: Finished saving build plugins
11:28:47 PM: Started saving pip cache
11:28:47 PM: Finished saving pip cache
11:28:47 PM: Started saving emacs cask dependencies
11:28:47 PM: Finished saving emacs cask dependencies
11:28:47 PM: Started saving maven dependencies
11:28:47 PM: Finished saving maven dependencies
11:28:47 PM: Started saving boot dependencies
11:28:47 PM: Finished saving boot dependencies
11:28:47 PM: Started saving rust rustup cache
11:28:47 PM: Finished saving rust rustup cache
11:28:47 PM: Started saving go dependencies
11:28:47 PM: Finished saving go dependencies
11:28:49 PM: Build script success
11:29:07 PM: Finished processing build request in 1m26.655546342s
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ahh okay, that makes sense. Thank you |
I'm running Next 11 and @netlify/plugin-nextjs 3.6.3 and seeing this message when I deploy. The plugin's
However the next.js team recommends you not use serverless. The results is a webpack 5 error that shows up with usage of next-auth — it tries to import all dynamic optional imports from TypeORM (which next-auth relies on) and is unable to find those dependencies and you'll get errors like this:
The only way I've been able to build using Next11 is without serverless mode. Is there a way to tell this plugin not to turn on serverless mode? |
@bcnichols3 hey! would you do me a huge favor and open a separate issue about this? don't think it belongs with 10.0.8 breakages. would appreciate it a bunch! we can discuss further there 🙏 |
done @lindsaylevine |
Describe the bug
We are experimenting with using netlify-plugin-nextjs instead of next-on-netlify in a yarn monorepo. Unfortunately, when we attempt to deploy with the plugin, we get a
Your next.config.js must set the "target" property to one of: serverless, experimental-serverless-trace. Update the target property to allow this plugin to run.
message. Attached are two screen shots, one of the next.config.js in question, and the second of the message:As you can see from the message screenshot, it is console logging
This file is detected
based on the next.config.js console.log statement, so it sees the correct file. I can also confirm that this is working if we use next-on-netlify directly.Expected behavior
Successful deployment
Versions
The text was updated successfully, but these errors were encountered: