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

I can run "npm run build", but can not "next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs" #39

Open
darrenli6 opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@darrenli6
Copy link

Describe the bug
I can run "npm run build", but can not "next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs"

To Reproduce
Steps to reproduce the behavior:

npm run build

(base) jiali@JiadeMacBook-Pro ourdownloader.com % npm run build

> [email protected] build
> next build && cross-env NODE_OPTIONS='--experimental-json-modules'  node ./scripts/postbuild.mjs

  ▲ Next.js 14.2.12
  - Environments: .env

   Creating an optimized production build ...
successCallback /Users/jiali/Documents/project/node/github.com/ourdownloader.com/.contentlayer
(node:82461) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:82461) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
Local search index generated...
Generated 28 documents in .contentlayer
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
 ✓ Compiled successfully
   Linting and checking validity of types  . ⨯ ESLint: Invalid Options: - Unknown options: useEslintrc, extensions - 'extensions' has been removed.
 ⚠ TypeScript project references are not fully supported. Attempting to build in incremental mode.
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
 ✓ Generating static pages (38/38)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                              Size     First Load JS
┌ ○ /_not-found                          879 B          88.4 kB
├ ● /[locale]                            4.79 kB         117 kB
├   ├ /en
├   └ /fr
├ ƒ /[locale]/[...not found]             141 B          87.7 kB
├ ƒ /[locale]/about/[...authors]         296 B          92.9 kB
├ ● /[locale]/blog                       4.35 kB         154 kB
├   ├ /en/blog
├   └ /fr/blog
├ ● /[locale]/blog/[...slug]             83.6 kB         229 kB
├   ├ /en/blog/code-sample
├   ├ /en/blog/deriving-ols-estimator
├   ├ /en/blog/github-markdown-guide
├   └ [+21 more paths]
├ ● /[locale]/projects                   2.89 kB         157 kB
├   ├ /en/projects
├   └ /fr/projects
├ ƒ /[locale]/sitemap.xml                0 B                0 B
├ ● /[locale]/tags                       1.8 kB         96.2 kB
├   ├ /en/tags
├   └ /fr/tags
├ ƒ /api/downloader                      0 B                0 B
├ ƒ /api/newsletter                      0 B                0 B
└ ○ /robots.txt                          0 B                0 B
+ First Load JS shared by all            87.6 kB
  ├ chunks/7023-8a43cd5ad6deb506.js      31.5 kB
  ├ chunks/fd9d1056-752ae5e8d9863c3c.js  53.7 kB
  └ other shared chunks (total)          2.36 kB


ƒ Middleware                             25.6 kB

○  (Static)   prerendered as static content
●  (SSG)      prerendered as static HTML (uses getStaticProps)
ƒ  (Dynamic)  server-rendered on demand

(node:82539) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:82539) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
RSS feeds generated...

next build && cross-env NODE_OPTIONS='--experimental-json-modules

image

in the vercel platform. error

image

Expected behavior

in the vercel platform. It does work well

Screenshots
If applicable, add screenshots to help explain your problem.

System Info (if dev / build issue):

  • mac
  • v18.18.0
  • Npm version

Browser Info (if display / formatting issue):

  • Device [e.g. Desktop, iPhone6]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@darrenli6 darrenli6 added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant