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

ES6 imports not working for only jsvat #124

Open
carlospnav opened this issue Feb 11, 2022 · 0 comments
Open

ES6 imports not working for only jsvat #124

carlospnav opened this issue Feb 11, 2022 · 0 comments

Comments

@carlospnav
Copy link

carlospnav commented Feb 11, 2022

Hi all,

We're trying to use the library at my company and we're having trouble having the es6 version work with our system.

As a workaround we are currently using the commonjs version but we're trying to figure out why the es6 version didn't work and were looking for some help.

This is the error message:
image

Our react app is not ejected but we're using this babel config file to do the parsing of code:

module.exports = {
  presets: [
    '@babel/preset-flow',
    '@babel/preset-react',
    [
      '@babel/preset-env',
      {
        targets: '>0.25%',
      },
    ],
    'module:metro-react-native-babel-preset',
  ],
  plugins: [
    '@babel/plugin-syntax-dynamic-import',
    'dynamic-import-node',
    'react-native-web',
  ],
  overrides: [
    {
      test: ['./src/**/*.ts'],
      presets: [
        '@babel/preset-typescript',
        '@babel/preset-react',
        [
          '@babel/preset-env',
          {
            targets: '>0.25%',
          },
        ],
      ],
    },
  ],
};

Weirdly enough, we are using other libraries in node_modules that make use of es6 language constructs without any issues.

This is our dependency tree:

    "@babel/cli": "^7.0.0",
    "@babel/core": "7.0.0",
    "@babel/plugin-syntax-dynamic-import": "^7.0.0",
    "@babel/preset-env": "^7.7.1",
    "@babel/preset-flow": "^7.0.0",
    "@babel/preset-react": "^7.8.3",
    "@babel/preset-typescript": "^7.7.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^9.0.0",
    "babel-jest": "^23.4.2",
    "babel-plugin-react-native-web": "^0.11.2",
    "cross-env": "^5.1.4",

Any ideas?

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

1 participant