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

Docz build failing for --> @babel/preset-env [exclude] option #1693

Open
malhar12 opened this issue Jan 13, 2022 · 2 comments
Open

Docz build failing for --> @babel/preset-env [exclude] option #1693

malhar12 opened this issue Jan 13, 2022 · 2 comments

Comments

@malhar12
Copy link

Environment for reproduction:

Command that I'm executing --> yarn docz build --typescript

failed Building production JavaScript and CSS bundles - 4.581s

ERROR #98123  WEBPACK
Generating JavaScript bundles failed
[BABEL] /app/.docz/.cache/polyfill-entry.js: @babel/preset-env: The
plugins/built-ins 'es.error.to-string, es.number.to-exponential' passed to the
'exclude' option are not valid. Please check data/[plugin-features|built-in-features].js in
babel-preset-env (While processing:
"/app/node_modules/@babel/preset-env/lib/index.js")
File: .cache/polyfill-entry.js

ERROR #98123  WEBPACK
Generating JavaScript bundles failed
[BABEL] /app/.docz/.cache/production-app.js: @babel/preset-env: The
plugins/built-ins 'es.error.to-string, es.number.to-exponential' passed to the
'exclude' option are not valid. Please check data/[plugin-features|built-in-features].js in
babel-preset-env (While processing:
"/app/node_modules/@babel/preset-env/lib/index.js")
File: .cache/production-app.js

Not sure, as to what the error is. It says that the plugins/built-ins that are passed to the exclude option are not valid. Tried to override it by passing empty array to it inside gatsby-node.js :

exports.onCreateBableConfig = ({actions}) => {

  actions.setBabelPreset({
    name: "@babel/preset-env",
    options: {
      exclude: []
    }
  });
}

A help here would be much appreciated, as all my builds are failing because it is failing to deploy the documentation.

@malhar12 malhar12 changed the title Docz build failing for --> @babel/preset-env Docz build failing for --> @babel/preset-env [exclude] option Jan 13, 2022
@imp-dance
Copy link

I'm also experiencing the following error while trying to run docz dev:

.../.docz/.cache/develop-static-entry.js: @babel/preset-env: The plugins/built-ins 'es.error.to-string,
es.number.to-exponential' passed to the 'exclude' option are not
    valid. Please check data/[plugin-features|built-in-features].js in
babel-preset-env (While processing: ".../node_modules/gatsby/node_modules/@babel/preset-env/lib/index.js")

File: .cache/develop-static-entry.js

not finished Building development bundle - 4.520s

This after installing docz onto a large React/Typescript project.

I've got no clue how to resolve this. Some insight into what might be causing this error would be really helpful.

@renatobenks
Copy link
Member

Hey guys, as far as I got the problem here, it's not related to docz itself as you have your own gatsby setup upfront. The problem is coming from babel-preset-gatsby where you might be using an unsupported version or in the wrong way.

Try to create a reproducible environment, so we can take a further look, but for both of you, the clue is around the babel-preset-gatsby and your gatsby configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants