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

"build --target wc" leads to "don't know how to turn this value into a node" #5746

Closed
fyyyyy opened this issue Aug 4, 2020 · 2 comments
Closed
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@fyyyyy
Copy link

fyyyyy commented Aug 4, 2020

Version

4.3.1

Environment info

node 10

Steps to reproduce

Build a vue webcomonent via
vue-cli-service build --target wc

Try to import this webcomponent in a storybook stories.js file via
import './dist/my-vue-comp.js';

Running storybook:build leads to Error:

info => Compiling preview..
ERR! => Failed to build the preview
ERR! ./packages/my-vue-comp/dist/my-vue-comp.js
ERR! Module build failed (from ./node_modules/babel-loader/lib/index.js):
ERR! Error: mono-cli/packages/my-vue-comp/dist/my-vue-comp.js: don't know how to turn this value into a node: function split() { [native code] }
ERR! at Object.valueToNode (mono-cli/node_modules/@babel/types/lib/converters/valueToNode.js:87:9)
ERR! at PluginPass.Expression (mono-cli/node_modules/babel-plugin-minify-constant-folding/lib/index.js:195:26)

What is expected?

build passes

What is actually happening?

build is failing


This code in the dist/my-vue-comp.js file seems to cause the issue.
Uncommenting this will pass the storybook:build

// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  // eslint-disable-next-line no-prototype-builtins
  return !Object('z').propertyIsEnumerable(0);
}) ? function (it) {
  return classof(it) == 'String' ? split.call(it, '') : Object(it);
} : Object;
@haoqunjiang
Copy link
Member

Sorry but we need a minimal runnable reproduction to see what's going wrong in your project. A simple piece of sample code is not enough for us to inspect.

@haoqunjiang haoqunjiang added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Aug 4, 2020
@haoqunjiang
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

2 participants