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

Compiling Failed #16

Open
emersonlaurentino opened this issue Oct 14, 2022 · 5 comments
Open

Compiling Failed #16

emersonlaurentino opened this issue Oct 14, 2022 · 5 comments

Comments

@emersonlaurentino
Copy link

I installed the plugin using the command sanity install tags and when I try to start the project, I received this problem.

$ sanity start
✔ Checking configuration files...
⠸ Compiling...webpack built 380c2db10379be37151f in 12011ms
✔ Compiling...
Failed to compile.

Error in ./node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js
Module parse failed: Unexpected token (306:11)
You may need an appropriate loader to handle this file type.
|   }
| 
|   return { ...rect,
|     x: rect.x - scroll.scrollLeft + offsets.x,
|     y: rect.y - scroll.scrollTop + offsets.y
 @ ./node_modules/react-select/dist/react-select.esm.js 23:0-26
 @ ./node_modules/sanity-plugin-tags/lib/components/Input.js (part:tags/components/input)
 @ ./node_modules/sanity-plugin-tags/lib/schemas/tags.js
 @ ./node_modules/sanity-plugin-tags/lib/schemas/tags.js (all:part:@sanity/base/schema-type)
 @ ./schemas/schema.js (part:@sanity/base/schema)
 @ ./node_modules/@sanity/default-layout/lib/schemaErrors/SchemaErrorReporter.js
 @ ./node_modules/@sanity/default-layout/lib/defaultLayout/DefaultLayout.js
 @ ./node_modules/@sanity/default-layout/lib/defaultLayout/index.js
 @ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
 @ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
 @ ./node_modules/@sanity/server/lib/browser/entry-dev.js
 @ multi ./node_modules/@sanity/server/lib/browser/entry-dev.js
@jameswyse
Copy link

Also getting this error, seems to be an issue with react-select + webpack JedWatson/react-select#5380

@jameswyse
Copy link

I've worked around this by modding the webpack configuration:

Create webpack.sanity.js in the root directory of your studio with the following:

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

@emersonlaurentino
Copy link
Author

I tested here and work well. Thanks @jameswyse

@tudormunteanu
Copy link

@jameswyse thanks! That works. What is the underlying problem here?

@BrumGB
Copy link

BrumGB commented Nov 22, 2022

I'm getting the same error after installing the plugin. Looks like a https://github.com/floating-ui/floating-ui issue maybe?

@jameswyse thanks for your suggestion, worked a treat :)

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

4 participants