Babel JS ошибка «не знаю, как превратить это значение в узел» - PullRequest
2 голосов
/ 26 мая 2020

После обновления webpack и babel я столкнулся с несколькими подобными ошибками в нашем наборе тестов vue -jest, и я не знаю, как go отлаживать их:

/home/rof/src/github.com/hubbado/hubbado_core/app/javascript/general-stats/views/GeneralStats/Controls.vue: don't know how to turn this value into a node

at valueToNode (node_modules/@babel/types/lib/converters/valueToNode.js:87:9)
at Object.valueToNode (node_modules/@babel/types/lib/converters/valueToNode.js:81:58)
at Object.exit (node_modules/istanbul-lib-instrument/dist/visitor.js:641:30)
at PluginPass.exit (node_modules/babel-plugin-istanbul/lib/index.js:158:38)
at newFn (node_modules/@babel/traverse/lib/visitors.js:179:21)
at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:55:20)
at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:42:17)
at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:99:8)
at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:112:16)
at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:84:19)
at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:140:19)
at Function.traverse.node (node_modules/@babel/traverse/lib/index.js:84:17)
at traverse (node_modules/@babel/traverse/lib/index.js:66:12)
at transformFile (node_modules/@babel/core/lib/transformation/index.js:107:29)
at transformFile.next (<anonymous>)
at run (node_modules/@babel/core/lib/transformation/index.js:35:12)

Это моя установленная версия babel:

$ yarn list --depth=1 | grep babel
├─ @babel/code-frame@7.8.3
├─ @babel/compat-data@7.9.6
├─ @babel/core@7.9.6
├─ @babel/generator@7.9.6
├─ @babel/helper-annotate-as-pure@7.8.3
├─ @babel/helper-builder-binary-assignment-operator-visitor@7.8.3
├─ @babel/helper-builder-react-jsx-experimental@7.9.5
├─ @babel/helper-builder-react-jsx@7.9.0
├─ @babel/helper-compilation-targets@7.9.6
├─ @babel/helper-create-class-features-plugin@7.9.6
├─ @babel/helper-create-regexp-features-plugin@7.8.8
├─ @babel/helper-define-map@7.8.3
├─ @babel/helper-explode-assignable-expression@7.8.3
├─ @babel/helper-function-name@7.9.5
├─ @babel/helper-get-function-arity@7.8.3
├─ @babel/helper-hoist-variables@7.8.3
├─ @babel/helper-member-expression-to-functions@7.8.3
├─ @babel/helper-module-imports@7.8.3
├─ @babel/helper-module-transforms@7.9.0
├─ @babel/helper-optimise-call-expression@7.8.3
├─ @babel/helper-plugin-utils@7.8.3
├─ @babel/helper-regex@7.8.3
├─ @babel/helper-remap-async-to-generator@7.8.3
├─ @babel/helper-replace-supers@7.9.6
├─ @babel/helper-simple-access@7.8.3
├─ @babel/helper-split-export-declaration@7.8.3
├─ @babel/helper-validator-identifier@7.9.5
├─ @babel/helper-wrap-function@7.8.3
├─ @babel/helpers@7.9.6
├─ @babel/highlight@7.9.0
├─ @babel/parser@7.9.6
├─ @babel/plugin-external-helpers@7.8.3
├─ @babel/plugin-proposal-async-generator-functions@7.8.3
├─ @babel/plugin-proposal-class-properties@7.8.3
├─ @babel/plugin-proposal-decorators@7.8.3
├─ @babel/plugin-proposal-do-expressions@7.8.3
├─ @babel/plugin-proposal-dynamic-import@7.8.3
├─ @babel/plugin-proposal-export-default-from@7.8.3
├─ @babel/plugin-proposal-export-namespace-from@7.8.3
├─ @babel/plugin-proposal-function-bind@7.8.3
├─ @babel/plugin-proposal-function-sent@7.8.3
├─ @babel/plugin-proposal-json-strings@7.8.3
├─ @babel/plugin-proposal-logical-assignment-operators@7.8.3
├─ @babel/plugin-proposal-nullish-coalescing-operator@7.8.3
├─ @babel/plugin-proposal-numeric-separator@7.8.3
├─ @babel/plugin-proposal-object-rest-spread@7.9.6
├─ @babel/plugin-proposal-optional-catch-binding@7.8.3
├─ @babel/plugin-proposal-optional-chaining@7.9.0
├─ @babel/plugin-proposal-pipeline-operator@7.8.3
├─ @babel/plugin-proposal-private-methods@7.8.3
├─ @babel/plugin-proposal-throw-expressions@7.8.3
├─ @babel/plugin-proposal-unicode-property-regex@7.8.8
├─ @babel/plugin-syntax-async-generators@7.8.4
├─ @babel/plugin-syntax-bigint@7.8.3
├─ @babel/plugin-syntax-class-properties@7.8.3
├─ @babel/plugin-syntax-decorators@7.8.3
├─ @babel/plugin-syntax-do-expressions@7.8.3
├─ @babel/plugin-syntax-dynamic-import@7.8.3
├─ @babel/plugin-syntax-export-default-from@7.8.3
├─ @babel/plugin-syntax-export-namespace-from@7.8.3
├─ @babel/plugin-syntax-flow@7.8.3
├─ @babel/plugin-syntax-function-bind@7.8.3
├─ @babel/plugin-syntax-function-sent@7.8.3
├─ @babel/plugin-syntax-import-meta@7.8.3
├─ @babel/plugin-syntax-json-strings@7.8.3
├─ @babel/plugin-syntax-jsx@7.8.3
├─ @babel/plugin-syntax-logical-assignment-operators@7.8.3
├─ @babel/plugin-syntax-nullish-coalescing-operator@7.8.3
├─ @babel/plugin-syntax-numeric-separator@7.8.3
├─ @babel/plugin-syntax-object-rest-spread@7.8.3
├─ @babel/plugin-syntax-optional-catch-binding@7.8.3
├─ @babel/plugin-syntax-optional-chaining@7.8.3
├─ @babel/plugin-syntax-pipeline-operator@7.8.3
├─ @babel/plugin-syntax-throw-expressions@7.8.3
├─ @babel/plugin-syntax-top-level-await@7.8.3
├─ @babel/plugin-syntax-typescript@7.8.3
├─ @babel/plugin-transform-arrow-functions@7.8.3
├─ @babel/plugin-transform-async-to-generator@7.8.3
├─ @babel/plugin-transform-block-scoped-functions@7.8.3
├─ @babel/plugin-transform-block-scoping@7.8.3
├─ @babel/plugin-transform-classes@7.9.5
├─ @babel/plugin-transform-computed-properties@7.8.3
├─ @babel/plugin-transform-destructuring@7.9.5
├─ @babel/plugin-transform-dotall-regex@7.8.3
├─ @babel/plugin-transform-duplicate-keys@7.8.3
├─ @babel/plugin-transform-exponentiation-operator@7.8.3
├─ @babel/plugin-transform-flow-strip-types@7.9.0
├─ @babel/plugin-transform-for-of@7.9.0
├─ @babel/plugin-transform-function-name@7.8.3
├─ @babel/plugin-transform-literals@7.8.3
├─ @babel/plugin-transform-member-expression-literals@7.8.3
├─ @babel/plugin-transform-modules-amd@7.9.6
├─ @babel/plugin-transform-modules-commonjs@7.9.6
├─ @babel/plugin-transform-modules-systemjs@7.9.6
├─ @babel/plugin-transform-modules-umd@7.9.0
├─ @babel/plugin-transform-named-capturing-groups-regex@7.8.3
├─ @babel/plugin-transform-new-target@7.8.3
├─ @babel/plugin-transform-object-assign@7.8.3
├─ @babel/plugin-transform-object-super@7.8.3
├─ @babel/plugin-transform-parameters@7.9.5
├─ @babel/plugin-transform-property-literals@7.8.3
├─ @babel/plugin-transform-react-display-name@7.8.3
├─ @babel/plugin-transform-react-jsx-development@7.9.0
├─ @babel/plugin-transform-react-jsx-self@7.9.0
├─ @babel/plugin-transform-react-jsx-source@7.9.0
├─ @babel/plugin-transform-react-jsx@7.9.4
├─ @babel/plugin-transform-regenerator@7.8.7
├─ @babel/plugin-transform-reserved-words@7.8.3
├─ @babel/plugin-transform-runtime@7.9.6
├─ @babel/plugin-transform-shorthand-properties@7.8.3
├─ @babel/plugin-transform-spread@7.8.3
├─ @babel/plugin-transform-sticky-regex@7.8.3
├─ @babel/plugin-transform-template-literals@7.8.3
├─ @babel/plugin-transform-typeof-symbol@7.8.4
├─ @babel/plugin-transform-typescript@7.9.6
├─ @babel/plugin-transform-unicode-regex@7.8.3
├─ @babel/preset-env@7.9.6
├─ @babel/preset-flow@7.9.0
├─ @babel/preset-modules@0.1.3
├─ @babel/preset-react@7.9.4
├─ @babel/preset-typescript@7.9.0
├─ @babel/runtime@7.9.6
├─ @babel/template@7.8.6
├─ @babel/traverse@7.9.6
├─ @babel/types@7.9.6
├─ @types/babel__core@7.1.7
├─ @types/babel__generator@7.6.1
├─ @types/babel__template@7.0.2
├─ @types/babel__traverse@7.0.11
├─ babel-jest@26.0.1
├─ babel-loader@8.1.0
├─ babel-plugin-dynamic-import-node@2.3.3
├─ babel-plugin-istanbul@6.0.0
├─ babel-plugin-jest-hoist@26.0.0
├─ babel-plugin-macros@2.8.0
├─ babel-preset-current-node-syntax@0.1.2
├─ babel-preset-jest@26.0.0
├─ babel-preset@1.1.4

И версия webpack:

$ yarn list --depth=1 | grep webpack
├─ @rails/webpacker@5.1.1
├─ case-sensitive-paths-webpack-plugin@2.3.0
├─ compression-webpack-plugin@3.1.0
├─ last-call-webpack-plugin@3.0.0
├─ optimize-css-assets-webpack-plugin@5.0.3
├─ pnp-webpack-plugin@1.6.4
├─ terser-webpack-plugin@2.3.6
├─ webpack-assets-manifest@3.1.1
├─ webpack-cli@3.3.11
├─ webpack-dev-middleware@3.7.2
├─ webpack-dev-server@3.11.0
├─ webpack-log@2.0.0
├─ webpack-modernizr-loader@5.0.0
├─ webpack-sources@1.4.3
├─ webpack@4.43.0
│  ├─ terser-webpack-plugin@1.4.3

Google, к сожалению, не сильно помог.

А теперь похоже, что мне нужно добавить еще немного ненужного текста, чтобы StackOverflow принял мой вопрос с таким количеством вставленного в него кода.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...