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:

Docz version: 2.3.1
Node version: 14.16.0
babel-preset-gatsby@0.12.3
gatsby-cli@2.19.3
gatsby-graphiql-explorer@0.11.0
gatsby-link@2.11.0
gatsby-page-utils@0.9.1
gatsby-plugin-alias-imports@1.0.5
gatsby-plugin-compile-es6-packages@2.1.1
gatsby-plugin-emotion@4.5.0
gatsby-plugin-eslint@2.0.8
gatsby-plugin-mdx@1.10.1
gatsby-plugin-page-creator@2.10.2
gatsby-plugin-react-helmet-async@1.2.0
gatsby-plugin-root-import@2.0.8
gatsby-plugin-typescript@2.12.1
gatsby-plugin-utils@0.9.0
gatsby-react-router-scroll@3.7.0
gatsby-recipes@0.9.3
gatsby-source-filesystem@2.11.1
gatsby-theme-docz@2.3.1

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