Seems like i'm stuck with my problems with loading a external umd component in vue.
I try to do something similar as
Vue 3 external component/plugin loading in runtime
This works for me using vue2 and webpack
Now I'm using Vue3/Vite and also the same source as in the Question above.
But when resolving the external component promise i get the following error when :
vue.js:1184 [Vue warn]: Unhandled error during execution of async component loader
at <AsyncComponentWrapper>
at <DemoComponent>
at <HelloWorld msg="Hello Vue 3.0 + Vite" >
at <App>
warn # vue.js:1184
logError # vue.js:1357
handleError # vue.js:1349
onError # vue.js:4637
(anonymous) # vue.js:4677
Promise.catch (async)
setup # vue.js:4676
callWithErrorHandling # vue.js:1300
setupStatefulComponent # vue.js:7561
setupComponent # vue.js:7522
mountComponent # vue.js:5264
processComponent # vue.js:5240
patch # vue.js:4861
mountChildren # vue.js:5043
processFragment # vue.js:5203
patch # vue.js:4854
componentEffect # vue.js:5357
reactiveEffect # vue.js:339
effect # vue.js:314
setupRenderEffect # vue.js:5322
mountComponent # vue.js:5280
processComponent # vue.js:5240
patch # vue.js:4861
mountChildren # vue.js:5043
processFragment # vue.js:5203
patch # vue.js:4854
componentEffect # vue.js:5357
reactiveEffect # vue.js:339
effect # vue.js:314
setupRenderEffect # vue.js:5322
mountComponent # vue.js:5280
processComponent # vue.js:5240
patch # vue.js:4861
mountChildren # vue.js:5043
processFragment # vue.js:5203
patch # vue.js:4854
componentEffect # vue.js:5357
reactiveEffect # vue.js:339
effect # vue.js:314
setupRenderEffect # vue.js:5322
mountComponent # vue.js:5280
processComponent # vue.js:5240
patch # vue.js:4861
render # vue.js:5937
mount # vue.js:4168
app.mount # vue.js:9324
(anonymous) # main.js:7
Show 16 more frames
external-component.js:11 Uncaught (in promise) TypeError: Chaining cycle detected for promise #<Promise>
at <anonymous>
at HTMLScriptElement.<anonymous> (external-component.js:11)
this is the Code for the promise
export default async function externalComponent(url) {
const name = url.split(`/`).reverse()[0].match(/^(.*?)\.umd/)[1];
if (window[name]) return window[name];
console.log('run');
window[name] = new Promise((resolve, reject) => {
script.async = true;
script.addEventListener(`load`, () => {
resolve(window[name]);
});
script.addEventListener(`error`, () => {
reject(new Error(`Error loading ${url}`));
});
script.src = url;
document.head.appendChild(script);
});
return window[name];
}
and use this in my DemoComponent:
<script lang="ts">
import externalComponent from '../external-component';
import { defineAsyncComponent } from 'vue'
const asyncComponent = defineAsyncComponent(
() => externalComponent(`http://localhost:8200/MyComponent/MyComponent.umd.min.js`)
)
export default {
name: 'DemoComponent',
components: {
MyComponent:asyncComponent
},
....
Can somebody help me with this?
update:
If import vue from vue/dist/vue.esm-bundler and set to global, then no need to change Vite config, and no need to load vue from cdn.
import * as Vue from 'vue/dist/vue.esm-bundler';
window.Vue = Vue;
After trying the link above, I had gotten the vue warn invalid vnode type symbol(static) (symbol) error.
By adding the following config in Vite.config.js, it works for me.
// vite.config.js
import { viteExternalsPlugin } from 'vite-plugin-externals'
export default {
plugins: [
viteExternalsPlugin({
vue: 'Vue'
}),
]
}
https://github.com/crcong/vite-plugin-externals
Related
I'm trying to bind background images dynamically but there seems to be trouble compiling the assets. What's weird is that it works but no at the same time.
I've tried various solutions from SO and nothing get rids of the compilation error (which still compile based on the image above):
Vue.js dynamic images not working
VueJS v-bind:style for background-image: url()
Vue.js data-bind style backgroundImage not working
reference assets with generated style data bind
Vue dynamic background image inline component
How The Project is Set Up
Laravel Sanctum as the backend, Vue SPA for the frontend and utilising Axios for communications.
Topic.vue Component
<div
v-for="topic in topics"
:key="topic.id"
class="col-12 col-sm-6 col-lg-3 mb-4 d-flex justify-content-center"
>
<div
class="card-topic d-flex align-items-end"
:style="inlineBgImage(topic.src)"
>
<div class="card-topic__button py-3 text-center w-100">
<a href class="card-topic__link">{{ topic.title }}</a>
</div>
</div>
</div>
Script in Topic.vue
<script>
import { mapState } from 'vuex'
export default {
computed: {
...mapState('topic', ['topics']),
},
created() {
this.$store.dispatch('topic/fetchTopics')
},
methods: {
inlineBgImage(src) {
let bgImage = require('#/assets' + src)
return {
backgroundImage: `url("${bgImage}")`,
}
},
},
}
</script>
In the inlineBgImage(src) methods, the background-image is successfully applied if the require is hardcoded i.e. let bgImage = require('#/assets/img/topic/myself.jpg'). Once I used the src value, it broked but still works(Failed to compile. page appear)
Assets
Below is the asset folder structure
All SCSS files are imported to app.scss which are then imported to main.js
_variables.scss
The "undefined variable" does exist
app.scss
This is how I import the _variable.scss file in app.scss; #import 'variables.scss';. The import comes first before other files.
I've also tried:
#import 'variables';
#import '_variables';
#import '_variables.scss';
It still gives out errors.
Error Details in Terminal
I want to reiterate that these errors does not appear if I hardcode the bgImage e.g. require('#/assets/img/topic/myself.jpg'). I don't understand how these changes affect the compiler.
ERROR Failed to compile with 6 errors 12:37:58 PM
error in ./src/assets/scss/card.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
16 │ background-color: $dark-blue;
│ ^^^^^^^^^^
╵
src\assets\scss\card.scss 16:23 root stylesheet
# ./src/assets/scss/card.scss 4:14-233 14:3-18:5 15:22-241
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./src/assets/scss/search.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
27 │ color: $blue;
│ ^^^^^
╵
src\assets\scss\search.scss 27:12 root stylesheet
# ./src/assets/scss/search.scss 4:14-235 14:3-18:5 15:22-243
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./src/assets/scss/image.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
33 │ color: $white;
│ ^^^^^^
╵
src\assets\scss\image.scss 33:12 root stylesheet
# ./src/assets/scss/image.scss 4:14-234 14:3-18:5 15:22-242
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./src/assets/scss/button.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
2 │ color: $light-blue;
│ ^^^^^^^^^^^
╵
src\assets\scss\button.scss 2:12 root stylesheet
# ./src/assets/scss/button.scss 4:14-235 14:3-18:5 15:22-243
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./src/assets/scss/header.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
4 │ background-color: $dark-blue;
│ ^^^^^^^^^^
╵
src\assets\scss\header.scss 4:23 root stylesheet
# ./src/assets/scss/header.scss 4:14-235 14:3-18:5 15:22-243
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./src/assets/scss/nav.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
6 │ color: $light-blue;
│ ^^^^^^^^^^^
╵
src\assets\scss\nav.scss 6:12 root stylesheet
# ./src/assets/scss/nav.scss 4:14-232 14:3-18:5 15:22-240
# ./src sync ^\.\/assets.*$
# ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue?vue&type=script&lang=js&
# ./src/views/Topic.vue
# ./src/router/index.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.100.14:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
Other Details
The topic.src from v-for="topic in topics" will yield a String, for e.g. /img/topic/myself.jpg.
inlineBgImage(src) {
let fileExt = src.substring(src.lastIndexOf('.'))
src = src.replace('/img/', '')
src = src.replace(fileExt, '')
let bgImage = require('#/assets/img/' + src + fileExt)
return {
backgroundImage: `url("${bgImage}")`,
}
}
Kudos to skirtle for giving a solution at forum.vuejs.org. As skirtle mentioned, Webpack handles expression and fixed string parameter differently. I did change the solution a bit in case future files have different file extension. You see skirtle original answer and explanation there.
What happens?
Vuejs instead of treating v-on:click / #click as an event handler it treats it as if I was adding a element. And triggers the following error
vue.common.js:593 [Vue warn]: Unknown custom element: <click> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <OrderTable> at resources\assets\js\components\OrderTable\OrderTable.vue
<Page> at resources\assets\js\components\Pages\Page.vue
<Root>
warn # vue.common.js:593
createElm # vue.common.js:5570
addVnodes # vue.common.js:5737
updateChildren # vue.common.js:5864
patchVnode # vue.common.js:5938
updateChildren # vue.common.js:5824
patchVnode # vue.common.js:5938
updateChildren # vue.common.js:5824
patchVnode # vue.common.js:5938
patch # vue.common.js:6098
Vue._update # vue.common.js:2672
updateComponent # vue.common.js:2790
get # vue.common.js:3144
run # vue.common.js:3221
flushSchedulerQueue # vue.common.js:2983
(anonymous) # vue.common.js:1839
flushCallbacks # vue.common.js:1760
I have simplified the component the error is happening in. But there is nothing special about the span that is triggering the error. It's a child of the root div element. Also the addRow method is irrelevant as the error happens no matter which function you bind to the click event.
<template>
<div>
<span v-on:click="addRow">Add new row</span>
</div>
</template>
<script>
export default {
name: "OrderTable",
methods: {
newRow: function () {
console.log('Adding new row')
},
}
This is the extract from app.js regarding the element:
_c("span", { on: { click: _vm.newRow } }, [_vm._v("Add new row")])
Question : I am new to Rally APP development, trying to build a simple application with a Release dropdown , when selected populates the grid.
However when I select the value, I am getting the following error Based upon this error
1. What does this mean ? - Uncaught TypeError: this.store.hydrateModel is not a function at constructor.initComponent" , and how to resolve this ?
====================================================================
App.js?_dc=0.59785698231437:43 Data: [constructor]
08:43:48.080 sdk-debug.js:185210 Uncaught TypeError: this.store.hydrateModel is not a function
at constructor.initComponent (sdk-debug.js:185210)
at constructor (sdk-debug.js:30211)
at constructor.callParent (sdk-debug.js:4469)
at constructor [as _componentConstructor] (sdk-debug.js:34291)
at constructor.callParent (sdk-debug.js:4469)
at constructor (sdk-debug.js:144823)
at constructor.callParent (sdk-debug.js:4469)
at constructor (sdk-debug.js:185132)
at new constructor (sdk-debug.js:5100)
at eval (eval at getInstantiator (sdk-debug.js:5720), <anonymous>:3:8)
initComponent # sdk-debug.js:185210
constructor # sdk-debug.js:30211
callParent # sdk-debug.js:4469
constructor # sdk-debug.js:34291
callParent # sdk-debug.js:4469
constructor # sdk-debug.js:144823
callParent # sdk-debug.js:4469
constructor # sdk-debug.js:185132
constructor # sdk-debug.js:5100
(anonymous) # VM20:3
instantiate # sdk-debug.js:5692
(anonymous) # sdk-debug.js:2303
_loadData # App.js?_dc=0.59785698231437:45
fire # sdk-debug.js:10046
continueFireEvent # sdk-debug.js:11447
fireEventArgs # sdk-debug.js:11425
prototype.fireEventArgs # sdk-debug.js:42297
object.(anonymous function) # sdk-debug.js:195692
fireEvent # sdk-debug.js:11411
onListSelectionChange # sdk-debug.js:149617
object.(anonymous function) # sdk-debug.js:195692
fire # sdk-debug.js:10046
continueFireEvent # sdk-debug.js:11447
fireEventArgs # sdk-debug.js:11425
fireEvent # sdk-debug.js:11411
maybeFireSelectionChange # sdk-debug.js:95171
doSingleSelect # sdk-debug.js:95145
doSelect # sdk-debug.js:94983
selectWithEvent # sdk-debug.js:94717
onItemClick # sdk-debug.js:95543
fire # sdk-debug.js:10046
continueFireEvent # sdk-debug.js:11447
fireEventArgs # sdk-debug.js:11425
prototype.fireEventArgs # sdk-debug.js:42297
fireEvent # sdk-debug.js:11411
processUIEvent # sdk-debug.js:96924
handleEvent # sdk-debug.js:96850
(anonymous) # VM60:7
wrap # sdk-debug.js:10800
==========================================================================
Code Below
enter code here
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
//specify the layout over here
defaults: { margin:10 },
// layout: 'border',
items: [
{ xtype:'container', itemId:'drop-downContainer',layout:'hbox' },
{ xtype:'container', itemId:'gridContainer',layout:'hbox' }
],
//var userStories: undefined;
launch: function() {
enter code here console.log('Entering the launch function');
this._loadUserStores();
},
_loadUserStores: function()
{ console.log("Entering the Load User Stories...");
var releaseComboBox = Ext.create('Rally.ui.combobox.ReleaseComboBox',{
itemId: 'releaseDropDown',
listeners: {
load: function(data,records,success){
console.log("Load is complete");
},
select: this._loadData,
scope: this
}
});
this.down('#drop-downContainer').add(releaseComboBox);
},
_loadData: function(myStore,data,success)
{ console.log("Entering the onLoad Data...");
console.log("Store --",myStore);
console.log("Data: ",data);
var datagrid= Ext.create('Rally.ui.grid.Grid',{
store: myStore,
columnCfgs: ['Name', 'ReleaseStartDate"', 'ReleaseDate', 'ObjectID', 'State', 'PlannedVelocity']
});
console.log("DataGrid is complete...");
//this.down('#gridContainer').add(datagrid);
}
});
The problem you're running into is myStore is not a store- it's the release combo box.
I'd check out the easy button for scoping apps to timeboxes: https://help.rallydev.com/apps/2.1/doc/#!/guide/timebox_filtering
And here's another example showing how to load/update a grid based on a combobox filter:
https://help.rallydev.com/apps/2.1/doc/#!/example/filterable-grid
I have decided to add bootstrap 4 to my Aurelia project.
It is an asp.net 2 solution with webpack.
This is what I did...
I removed bootstrap 3 and added bootstrap 4 via npm.
I added popper.js using npm next.
I rebuilt the solution which compiled ok.
I then ran the solution to find I now have the following error.
content - script.bundle.js:333 loading pref showConsoleLogs before prefs were initialised, you will not get the correct result
getPref # content-script.bundle.js:333
(anonymous) # content-script.bundle.js:481
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:521
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:593
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:621
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1346
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1662
a # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:2097
a # content-script.bundle.js:1
u # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:2106
(anonymous) # content-script.bundle.js:1
(anonymous) # content-script.bundle.js:2100
ReferenceError: $ is not defined
at Object.65 (bootstrap.js:3849)
at __webpack_require__ (bootstrap d7bcc5cf3ba589d57197:659)
at fn (bootstrap d7bcc5cf3ba589d57197:85)
at Object.boot(validation - renderer - custom - attribute.js:20)
at __webpack_require__ (bootstrap d7bcc5cf3ba589d57197:659)
at fn (bootstrap d7bcc5cf3ba589d57197:85)
at WebpackLoader.<anonymous>(aurelia - loader - webpack.js:176)
at step (aurelia - loader - webpack.js:36)
at Object.next(aurelia - loader - webpack.js:17)
at aurelia- loader - webpack.js:11
Promise rejected (async)
(anonymous) # aurelia-bootstrapper.js:146
(anonymous) # aurelia-bootstrapper.js:145
Promise resolved (async)
run # aurelia-bootstrapper.js:136
(anonymous) # aurelia-bootstrapper.js:161
45 # app.js?v = W7oxVndIkrRrS4plh4l6MCNBU4PUsPEnfFxcjfVxtDg:16384
__webpack_require__ # bootstrap d7bcc5cf3ba589d57197: 659
fn # bootstrap d7bcc5cf3ba589d57197: 85
83 # app.js?v = W7oxVndIkrRrS4plh4l6MCNBU4PUsPEnfFxcjfVxtDg:27388
__webpack_require__ # bootstrap d7bcc5cf3ba589d57197: 659
0.__webpack_exports__.e # bootstrap d7bcc5cf3ba589d57197: 708
(anonymous) # bootstrap d7bcc5cf3ba589d57197: 708
client.js:82[HMR] connected
here is my webpack vendor file.
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var extractCSS = new ExtractTextPlugin('vendor.css');
module.exports = ({ prod } = {}) => {
const isDevBuild = !prod;
return [{
stats: { modules: false },
resolve: {
extensions: ['.js']
},
module: {
loaders: [
{ test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, loader: 'url-loader?limit=100000' },
{ test: /\.css(\?|$)/, loader: extractCSS.extract([isDevBuild ? 'css-loader' : 'css-loader?minimize']) }
]
},
entry: {
vendor: [
'aurelia-event-aggregator',
'aurelia-fetch-client',
'aurelia-framework',
'aurelia-history-browser',
'aurelia-logging-console',
'aurelia-pal-browser',
'aurelia-polyfills',
'aurelia-route-recognizer',
'aurelia-router',
'aurelia-templating-binding',
'aurelia-templating-resources',
'aurelia-templating-router',
'aurelia-validation',
'jquery',
'bootstrap',
'bootstrap/dist/css/bootstrap.css',
],
},
output: {
path: path.join(__dirname, 'wwwroot', 'dist'),
publicPath: 'dist/',
filename: '[name].js',
library: '[name]_[hash]',
},
plugins: [
extractCSS,
new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable)
new webpack.DllPlugin({
path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
name: '[name]_[hash]'
})
].concat(isDevBuild ? [] : [
new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } })
])
}]
};
I do not have the depth of knowledge to decifer these and figure I have left out a step in the installation of bootstrap 4.
Does anybody know how bootstrap 4 should be installed into a webpack project?
Have a look at this pull request to aurelia-skeleton-navigation repository
https://github.com/aurelia/skeleton-navigation/pull/874
It bumps up bootstrap dependency to v4
Whenever I install a new package via npm install my angular 2 import is not recognizing the package and my browser returns 404 error.
For example, I've been trying to install the following package:
https://github.com/dougludlow/ng2-bs3-modal
and this is what my browser returns:
GET http://localhost:3000/node_modules/ng2-bs3-modal/ng2-bs3-modal 404 (Not Found)fetchTextFromURL # system.src.js:1154(anonymous function) # system.src.js:1710ZoneAwarePromise # angular2-polyfills.js:589(anonymous function) # system.src.js:1709(anonymous function) # system.src.js:2734(anonymous function) # system.src.js:3308(anonymous function) # system.src.js:3575(anonymous function) # system.src.js:3960(anonymous function) # system.src.js:4419(anonymous function) # system.src.js:4671(anonymous function) # system.src.js:406ZoneDelegate.invoke # angular2-polyfills.js:332Zone.run # angular2-polyfills.js:227(anonymous function) # angular2-polyfills.js:576ZoneDelegate.invokeTask # angular2-polyfills.js:365Zone.runTask # angular2-polyfills.js:263drainMicroTaskQueue # angular2-polyfills.js:482ZoneTask.invoke # angular2-polyfills.js:434
angular2-polyfills.js:332 Error: Error: XHR error (404 Not Found) loading http://localhost:3000/node_modules/ng2-bs3-modal/ng2-bs3-modal(…)
Although I can see that node_modules\ng2-bs3-modal is existing.
What's wrong here?
You need to configure SystemJS to load right files from the library.
You could try the following configuration:
<script>
System.configure({
map: {
'ng2-bs3-modal': 'node_modules/ng2-bs3-modal'
},
packages: {
'ng2-bs3-modal': {
format: 'register',
defaultExtension: 'js'
}
}
});
(...)
</script>