You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installing a component and then importing it raises an error:
on serve - the following errors exist:
'define' is not defined (no-undef) at components/product-list/dist/main.js:1:123:
and more errors...
And this is shown in the browser:
vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <ProductList> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <App> at src/App.vue
<Root>
STR:
create a new vue cli project with version 3 (npx @vue/cli create new-project). Cd and install.
The difference between bit import and npm install is when you use bit import we added the path of the component in the package.json in the form of file: [comp-path].
Then npm create the folder in the node_modules using a symlink.
By default webpack resolve symlink to the real path which breaks babel.
It can be disabled in the webpack.config via the vue.config.js
read more about it here: https://cli.vuejs.org/guide/troubleshooting.html#symbolic-links-in-node-modules vuejs-templates/webpack-simple#171 (comment)
@JoshK2 will put a vue.config.js for example that works as expected.
Installing a component and then importing it raises an error:
on serve - the following errors exist:
'define' is not defined (no-undef) at components/product-list/dist/main.js:1:123:
and more errors...
And this is shown in the browser:
STR:
The text was updated successfully, but these errors were encountered: