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

Deploy Error While Building Sanity started to happen 3 days ago #110

Closed
kuleyu opened this issue Nov 25, 2022 · 8 comments
Closed

Deploy Error While Building Sanity started to happen 3 days ago #110

kuleyu opened this issue Nov 25, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@kuleyu
Copy link

kuleyu commented Nov 25, 2022

Here are the deployment logs:

18:26:42.680 | [4/4] Building fresh packages...
18:26:45.597 | success Saved lockfile.
18:26:45.602 | Done in 82.03s.
18:26:45.676 | Done in 1m 23.6s
18:26:45.689 | Detected Next.js version: 12.3.0
18:26:45.698 | Running "pnpm run build"
18:26:46.318 |  
18:26:46.318 | > hull@2.6.0 build /vercel/path0
18:26:46.318 | > echo 'Building Sanity to public/studio…' && cd studio && npx sanity build ../public/studio -y && cd .. && next build
18:26:46.319 |  
18:26:46.325 | Building Sanity to public/studio…
18:26:48.903 | - Clearing output folder
18:26:48.907 | ✔ Clearing output folder (8ms)
18:26:48.908 | - Building Sanity
18:27:19.810 | ✖ Building Sanity
18:27:19.811 |  
18:27:19.811 | Error: Errors while building:
18:27:19.811 | ./node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js
18:27:19.811 | Module parse failed: Unexpected token (307:11)
18:27:19.811 | You may need an appropriate loader to handle this file type.
18:27:19.812 | \|   }
18:27:19.812 | \|
18:27:19.812 | \|   return { ...rect,
18:27:19.812 | \|     x: rect.x - scroll.scrollLeft + offsets.x,
18:27:19.812 | \|     y: rect.y - scroll.scrollTop + offsets.y
18:27:19.812 | @ ./node_modules/react-select/dist/react-select.esm.js 24:0-26
18:27:19.812 | @ ./node_modules/sanity-plugin-media/dist/components/SearchFacetTags/index.js
18:27:19.813 | @ ./node_modules/sanity-plugin-media/dist/components/Controls/index.js
18:27:19.813 | @ ./node_modules/sanity-plugin-media/dist/components/Browser/index.js
18:27:19.813 | @ ./node_modules/sanity-plugin-media/dist/app.js
18:27:19.813 | @ ./node_modules/sanity-plugin-media/dist/index.js
18:27:19.813 | @ ./node_modules/sanity-plugin-media/dist?sanityPart=all%3Apart%3A%40sanity%2Fbase%2Ftool
18:27:19.813 | @ ./node_modules/@sanity/default-layout/lib/util/getRegisteredTools.js
18:27:19.813 | @ ./node_modules/@sanity/default-layout/lib/router.js
18:27:19.813 | @ ./node_modules/@sanity/default-layout/lib/Root.js?sanityPart=part%3A%40sanity%2Fbase%2Froot
18:27:19.813 | @ ./node_modules/@sanity/base/lib/components/SanityRoot.js?sanityPart=part%3A%40sanity%2Fbase%2Fsanity-root
18:27:19.814 | @ ./node_modules/@sanity/server/lib/browser/entry.js
18:27:19.814 | @ multi ./node_modules/@sanity/server/lib/browser/entry.js
18:27:19.814 | at buildStaticAssets (~/path0/studio/node_modules/@sanity/core/lib/actions/build/buildStaticAssets.js:103:13)
18:27:19.869 | ELIFECYCLE  Command failed with exit code 1.
18:27:19.891 | Error: Command "pnpm run build" exited with 1

It seems that the error may be caused by some dependencies' update, as there is no error 3 days ago, and no error in my local building progress.

How can we solve this problem? Thank you in advance!

@kasperbirch1
Copy link

I'm experiencing the same issue 👀

@jwoa
Copy link

jwoa commented Nov 26, 2022

Same here, can't get it working from the Vercel one click either

@ndimatteo
Copy link
Owner

This sounds like an issue with either the sanity studio packages, or the sanity-plugin-media plugin. Can you try upgrading the versions and see if you're able to build and deploy?

@ndimatteo ndimatteo assigned ndimatteo and unassigned ndimatteo Nov 26, 2022
@ndimatteo ndimatteo added the bug Something isn't working label Nov 26, 2022
@jwoa
Copy link

jwoa commented Nov 26, 2022

Thanks! I’ll try a manual install and upgrade the packages like you said. My issue was with the automatic deploys on vercel only, the sanity one click worked just fine.

@kasperbirch1
Copy link

kasperbirch1 commented Nov 27, 2022

I've had success going to the studio folder and running
yarn add sanity-plugin-media@1.4.13

@anendlesssupply
Copy link

I believe I hit the same issue (deploying to Netlify though). I solved it by adding a webpack.sanity.js file in the studio folder, with the following config:

module.exports = function (config, options) {
    config.module.rules[0].exclude =
      /(node_modules|bower_components)\/(?!@floating-ui)/;
    return config;
  };

@kuleyu
Copy link
Author

kuleyu commented Nov 27, 2022

I've had success going to the studio folder and running yarn add sanity-plugin-media@1.4.13

Thanks @kasperbirch1, @ndimatteo and @anendlesssupply, it works. So the bug seems to be brought by its new version sanity-plugin-media@1.4.14 (2022-11-22).

@ndimatteo
Copy link
Owner

Closing for the same reason as this: #114 (comment)

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

5 participants