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

path.isInStrictMode is not a function #8029

Closed
CoderK opened this issue May 24, 2018 · 5 comments
Closed

path.isInStrictMode is not a function #8029

CoderK opened this issue May 24, 2018 · 5 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@CoderK
Copy link

CoderK commented May 24, 2018

Bug Report

Current Behavior

When I ran tests with webpack build, the following error occurred.

HeadlessChrome 66.0.3359 (Mac OS X 10.11.5) ERROR
  Uncaught Error: Module build failed: Thread Loader (Worker 0)
  path.isInStrictMode is not a function

      at classTransformer (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:655:27)
      at transformClass (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:697:10)
      at PluginPass.ClassExpression (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/plugin-transform-classes/lib/index.js:104:54)
      at newFn (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/visitors.js:243:21)
      at NodePath._call (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/path/context.js:65:18)
      at NodePath.call (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/path/context.js:40:17)
      at NodePath.visit (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/path/context.js:100:12)
      at TraversalContext.visitQueue (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/context.js:144:16)
      at TraversalContext.visitSingle (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/context.js:104:19)
      at TraversalContext.visit (/Users/Naver/Workspace/ugc/SE-Rabbit/node_modules/@babel/traverse/lib/context.js:185:19)
  at test.entry.js:23043

Babel Configuration (.babelrc, package.json, cli command)

{
        test: /\.jsx?$/,
        use: [
            "thread-loader",
            "cache-loader",
            {
                loader: "babel-loader",
                options: {
                    presets: [
                        [
                            "@babel/preset-env",
                            {
                                loose: false,
                                debug: false,
                                useBuiltIns: "usage",
                                targets: {
                                    browsers: ["ie >= 10"]
                                }
                            }
                        ],
                        "@babel/preset-react",
                    ],
                    plugins: [
                        "@babel/plugin-transform-runtime",
                        ["@babel/plugin-proposal-decorators", { legacy: true }],
                        "@babel/plugin-proposal-object-rest-spread",
                        "@babel/plugin-proposal-class-properties",
                        "@babel/plugin-syntax-dynamic-import"
                    ]
                }
            }
        ],
        exclude: /node_modules/
    }

Environment

  • Babel version(s): v7.0.0-beta.44
  • Node/npm version: node 8.10.0 / npm 6.0.1
  • OS: OSX 10.11.5 Elcapitan
  • Monorepo: lerna with yarn
  • How you are using Babel: loader

Additional context/Screenshots

This is my package.json

"dependencies": {
    "@babel/runtime": "^7.0.0-beta.47"
  },
  "devDependencies": {
    "@babel/core": "7.0.0-beta.44",
    "@babel/plugin-proposal-class-properties": "7.0.0-beta.44",
    "@babel/plugin-proposal-decorators": "^7.0.0-beta.47",
    "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.44",
    "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.44",
    "@babel/plugin-transform-runtime": "^7.0.0-beta.44",
    "@babel/polyfill": "7.0.0-beta.44",
    "@babel/preset-env": "^7.0.0-beta.44",
    "@babel/preset-react": "7.0.0-beta.44",
    "@egjs/react-layout": "^1.2.13",
    "babel-eslint": "^7.2.3",
    "babel-loader": "^8.0.0-beta.0",
    "babel-plugin-istanbul": "^4.0.0",
    "babel-preset-es2015-mod": "^6.6.0",
    "babel-preset-es3": "^1.0.1",
    "cache-loader": "^1.2.2",
    "chai": "^4.1.2",
    "circular-dependency-plugin": "^4.3.0",
    "copy-webpack-plugin": "^4.2.3",
    "cross-env": "^3.2.4",
    "enzyme": "^3.3.0",
    "enzyme-adapter-react-16": "^1.1.1",
    "eslint": "^3.19.0",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-jsx-a11y": "^3.0.2",
    "eslint-plugin-react": "^6.9.0",
    "find-imports": "^0.5.2",
    "generator-smarteditor": "file:packages/generator-smarteditor",
    "gh-pages": "^1.1.0",
    "husky": "^0.14.3",
    "istanbul-instrumenter-loader": "^3.0.0",
    "karma": "^1.7.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.1",
    "karma-coverage-istanbul-reporter": "^1.4.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-mocha": "^1.3.0",
    "karma-mocha-reporter": "^2.2.5",
    "karma-requirejs": "^1.1.0",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-stacktrace": "^1.0.3",
    "karma-webpack": "^2.0.6",
    "karma-webpack-grep": "^1.0.1",
    "lerna": "3.0.0-beta.21",
    "lint-staged": "^7.1.2",
    "mocha": "^3.5.3",
    "promise-polyfill": "^7.0.0",
    "requirejs": "^2.3.5",
    "sass-lint": "^1.11.1",
    "sinon": "^2.4.1",
    "slash": "^1.0.0",
    "tap-xunit": "^1.7.0",
    "thread-loader": "^1.1.5",
    "valimate": "^2.3.0",
    "webpack": "3.9.1",
    "yarn": "1.6.0"
  }
@babel-bot
Copy link
Collaborator

Hey @CoderK! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@hzoo
Copy link
Member

hzoo commented May 24, 2018

This method was added in #7712 so pretty sure it's just using a version that is old somehow

I would just ask that you clear your cache/node_modules, and make sure your dependencies are the same version. Having some be ^ like "@babel/plugin-proposal-decorators": "^7.0.0-beta.47", is confusing and is probably the issue.

@CoderK
Copy link
Author

CoderK commented May 25, 2018

@hzoo
Thank to you! I solved this issue.

@TomasRas
Copy link

Same here.
My package json:

`"devDependencies": {
"@babel/core": "7.0.0-beta.44",
"@babel/plugin-syntax-jsx": "^7.0.0-beta.49",
"@babel/plugin-transform-react-jsx": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/register": "^7.0.0-beta.49",
"autoprefixer": "^8.4.1",
"babel-eslint": "^8.2.3",
"babel-loader": "^8.0.0-beta.0",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.12.0",
"file-loader": "^1.1.11",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"jasmine": "^3.1.0",
"jsdom": "^11.11.0",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "^4.9.0",
"postcss-loader": "^2.1.5",
"resolve-url-loader": "^2.3.0",
"rimraf": "^2.6.2",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "^4.12.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.0.2",
"webpack-dev-server": "^3.1.4"

}
{
"presets": [
"@babel/preset-env"
],
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "jsx"
}
],
"@babel/plugin-syntax-jsx"
]
}

`

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jun 10, 2018

  1. Update babel/core to beta.49. All the Babel packages should be at the same version
  2. Don't use ^ in beta versions, since there could be breaking changes

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 9, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants