Open FF-ru opened 5 years ago
What bundler you use? It looks it doesn't support UMD modules.
nuxt2 exists webpack4.26.1 it worked fine with webpack3 on nuxtjs
just tried to assemble with clean webpack4.26.1 without vuejs and nuxtjs so it works. I have no idea
I would suggest you check webpack's config you use to bundle your app.
same with vuejs .-.
@FF-ru adding modules: 'commonjs'
to the build.babel.presets fix this issue
For example:
babel: {
presets({ isServer }) {
return [
[
require.resolve('@nuxt/babel-preset-app'),
{
//targets: isServer ? { node: '10' } : { ie: '11' },
//corejs: { version: 3 },
modules: 'commonjs'
}
]
]
}
}
For vue this should work:
babel: {
presets: [
[
'@babel/env',
{
//targets: {
// node: 'current'
//},
modules: 'commonjs'
}
]
]
}
trying to include charting_library
let { widget } = require('~/assets/js/charting_library.min')
it throws: Uncaught TypeError: Cannot read property 'TradingView' of undefined