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

[vercel] build fails with 'fse.writeJson is not a function' #565

Closed
hartmut-co-uk opened this issue Jul 12, 2022 · 5 comments
Closed

[vercel] build fails with 'fse.writeJson is not a function' #565

hartmut-co-uk opened this issue Jul 12, 2022 · 5 comments
Assignees

Comments

@hartmut-co-uk
Copy link
Collaborator

Hi, I tried adding image-edge to my nuxt3 app, starts up fine locally but doesn't build any longer on vercel.

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview"
  },
  "devDependencies": {
    "@nuxt/image-edge": "^1.0.0-27621400.93ce78a",
    "@nuxtjs/tailwindcss": "^5.2.0",
    "nuxt": "3.0.0-rc.4",
    "tailwind-scrollbar": "^1.3.1"
  },
  "dependencies": {}
}
    modules: [
        '@nuxtjs/tailwindcss',
        '@nuxt/image-edge',
    ],
[18:28:55.082] Retrieving list of deployment files...
[18:28:57.872] Downloading 123 deployment files...
[18:29:04.664] Looking up build cache...
[18:29:04.901] Build Cache not found
[18:29:05.128] Running "vercel build"
[18:29:05.588] Vercel CLI 27.0.1
[18:29:05.807] Installing dependencies...
[18:29:06.149] yarn install v1.22.17
[18:29:06.213] [1/4] Resolving packages...
[18:29:06.496] [2/4] Fetching packages...
[18:29:14.537] warning [email protected]: The engine "vscode" appears to be invalid.
[18:29:14.542] [3/4] Linking dependencies...
[18:29:14.544] warning "@nuxtjs/tailwindcss > @nuxt/postcss8 > [email protected]" has unmet peer dependency "webpack@^4.27.0 || ^5.0.0".
[18:29:14.545] warning "@nuxtjs/tailwindcss > @nuxt/postcss8 > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[18:29:19.754] [4/4] Building fresh packages...
[18:29:20.668] Done in 14.52s.
[18:29:20.885] Running "yarn run build"
[18:29:21.061] yarn run v1.22.17
[18:29:21.093] $ nuxt build
[18:29:21.167] [log] Nuxt CLI v3.0.0-rc.4
[18:29:23.629] [info] [nuxt:tailwindcss] Using Tailwind CSS from ~/assets/tailwind.css
[18:29:23.632] [info] [nuxt:tailwindcss] Merging Tailwind config from ~/tailwind.config.js
[18:29:23.638] [error] fse.writeJson is not a function
[18:29:23.638]   at Object.vercel [as setup] (node_modules/@nuxt/image-edge/dist/module.mjs:71:15)
[18:29:23.638]   at async setup (node_modules/@nuxt/image-edge/dist/module.mjs:172:9)
[18:29:23.638]   at async Object.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:582:5)
[18:29:23.638]   at async installModule (node_modules/@nuxt/kit/dist/index.mjs:398:3)
[18:29:23.639]   at async initNuxt (node_modules/nuxt/dist/index.mjs:1334:7)
[18:29:23.639]   at async loadNuxt (node_modules/nuxt/dist/index.mjs:1361:5)
[18:29:23.639]   at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:662:19)
[18:29:23.639]   at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:29:18)
[18:29:23.639]   at async _main (node_modules/nuxi/dist/cli.mjs:46:20)
[18:29:23.660] error Command failed with exit code 1.
[18:29:23.660] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[18:29:23.679] Error! Command "yarn run build" exited with 1
[18:29:23.739] Error: Command "vercel build" exited with 1
@zernonia
Copy link
Contributor

zernonia commented Jul 12, 2022

Happening to me too. I created a clean repo on stackblitz and deploy on Vercel (just to make sure), but the error persist.

Stackblitz: https://stackblitz.com/edit/nuxt-starter-4vahug?file=README.md,app.vue

Running "npm run build"
--
00:42:16.649 |  
00:42:16.650 | > build
00:42:16.650 | > nuxt build
00:42:16.650 |  
00:42:16.739 | [log] Nuxt CLI v3.0.0-rc.4
00:42:20.078 | [error] fse.writeJson is not a function
00:42:20.079 | at Object.vercel [as setup] (node_modules/@nuxt/image-edge/dist/module.mjs:71:15)
00:42:20.079 | at async setup (node_modules/@nuxt/image-edge/dist/module.mjs:172:9)
00:42:20.079 | at async Object.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:582:5)
00:42:20.079 | at async installModule (node_modules/@nuxt/kit/dist/index.mjs:398:3)
00:42:20.079 | at async initNuxt (node_modules/nuxt/dist/index.mjs:1334:7)
00:42:20.080 | at async loadNuxt (node_modules/nuxt/dist/index.mjs:1361:5)
00:42:20.080 | at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:662:19)
00:42:20.080 | at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:29:18)
00:42:20.080 | at async _main (node_modules/nuxi/dist/cli.mjs:46:20)
00:42:20.120 | Error! Command "npm run build" exited with 1
00:42:20.194 | Error: Command "vercel build" exited with 1

@pi0 pi0 self-assigned this Jul 12, 2022
pi0 added a commit that referenced this issue Jul 12, 2022
@hartmut-co-uk
Copy link
Collaborator Author

fixed it for me! ⚡ 🦄

@pi0
Copy link
Member

pi0 commented Jul 12, 2022

Should be fixed with the last edge release (23076b8) Only please note vercel image provider seems broken likely due to output configuration changes.

ghost pushed a commit to kuroji-fusky/kurojifusky.com that referenced this issue Jul 12, 2022
Had to disable `nuxt/image` due to something with Vercel image provider (nuxt/image#565 (comment))
@hartmut-co-uk
Copy link
Collaborator Author

hartmut-co-uk commented Jul 13, 2022

shall I open a new separate issue for this?

@hartmut-co-uk
Copy link
Collaborator Author

ref #569

procrates pushed a commit to procrates/nuxt-image that referenced this issue Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants