Example not works as expected
msaiducar opened this issue · 9 comments
Hi,
I tried to run example project using the npm install
and npm start
command consecutively, however got an error:
This dependency was not found:
* bpmn-js/dist/bpmn-navigated-viewer.production.min.js in ./node_modules/vue-bpmn/dist/index.esm.js
To install it, you can run: npm install --save bpmn-js/dist/bpmn-navigated-viewer.production.min.js
How could I fix that error?
in package.json&package-lock.json files, the section "dependencies",change "vue-bpmn": "file:.." to "vue-bpmn": "0.2.0".after this,it's can running for me.
Cannot reproduce your issue:
git clone git@github.com:bpmn-io/vue-bpmn.git
cd vue-bpmn
npm install
cd example
npm install && npm start
Here what I did, and got.
Cloning into 'vue-bpmn'...
remote: Enumerating objects: 71, done.
remote: Counting objects: 100% (71/71), done.
Receiving objects: 7% (5/71) (46/46), done.
Receiving objects: 77% (55/71) ed 56 (delta 18), pack-reused 0eceiving objects: 76% (54/71)
Receiving objects: 100% (71/71), 316.89 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (30/30), done.
cd vue-bpmn
npm install
added 198 packages from 172 contributors and audited 1947 packages in 4.224s
found 30 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
cd example\
npm install
added 106 packages from 51 contributors and audited 180 packages in 2.374s
found 2 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
npm start
> vue-bpmn-example@0.0.0 start C:\Users\s.ucar\third-party\vue-bpmn\example
> serve
UPDATE AVAILABLE The latest version of `serve` is 11.1.0
┌───────────────────────────────────────────────┐
│ │
│ Serving! │
│ │
│ - Local: http://localhost:5000 │
│ - On Your Network: http://10.0.75.1:5000 │
│ │
│ Copied local address to clipboard! │
│ │
└───────────────────────────────────────────────┘
In my browser, I hit the URL 'http://localhost:5000/public/' , I can see the text but not the bpmn diagram. I tried both Firefox and Chrome. In the browser's console;
The script from “http://localhost:5000/node_modules/vue-bpmn/dist/vue-bpmn.umd.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
The script from “http://localhost:5000/node_modules/vue-bpmn/dist/vue-bpmn.umd.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Loading failed for the <script> with source “http://localhost:5000/node_modules/vue-bpmn/dist/vue-bpmn.umd.js”.
ReferenceError: VueBpmn is not defined
What is your npm
version:
npm -v
npm -v
6.10.1
npm version is 6.9.0
here's my steps:
-
git clone https://github.com/bpmn-io/vue-bpmn.git
-
cd vue-bpmn
-
npm install
:audited 147 packages in 1.207s found 0 vulnerabilities
-
cd example
-
npm install
:audited 179 packages in 0.854s found 0 vulnerabilities
-
npm start
:> vue-bpmn-example@0.0.0 start /home/gordon/Documents/repo/github/vue-bpmn/example > serve UPDATE AVAILABLE The latest version of `serve` is 11.1.0 ┌───────────────────────────────────────────────────┐ │ │ │ Serving! │ │ │ │ - Local: http://localhost:5000 │ │ - On Your Network: http://172.21.41.112:5000 │ │ │ │ Copied local address to clipboard! │ │ │ └───────────────────────────────────────────────────┘
It reveals the packaged vue-bpmn
version is missing
Since we use a local dependency in the example, we have to bundle it first: npm run bundle
. So it would look like (overall):
git clone git@github.com:bpmn-io/vue-bpmn.git
cd vue-bpmn
npm install
npm run bundle
cd example
npm install && npm start
We should consider adding this instruction in the example's README
.