retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
9.86k stars 647 forks source link

After build not working #238

Closed borja010 closed 5 years ago

borja010 commented 5 years ago

Good morning,

Im having an issue after building the application. This error is while using the context-menu-plugin.

I did ng build --prod on my application and when Im trying to press the right click on the nodes, the menu is not displaying. I run the build locally and the only error that I was able to identify is the one displayed below:

image

Thank you very much for the assistance.

Ni55aN commented 5 years ago

Please provide an parts of your code. And how do you serve the /dist?

borja010 commented 5 years ago

Good afternoon,

Im trying it two different ways, one locally by using the next command:

npx http-server dist/movistar-material

And the other one is inside a container using the forever library.

Im doing the build by ng build --prod. I did a verbose and this is the log that is related with the context menu:

[./node_modules/vue/dist/vue.runtime.esm.js] 207 KiB {vendor} [built]
     cjs require vue [./node_modules/rete-context-menu-plugin/build/context-menu-plugin.min.js] 6:6339-6353
     cjs require vue [./node_modules/rete-vue-render-plugin/build/vue-render-plugin.min.js] 6:6321-6335
 [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {vendor} [built]
     cjs require module [./node_modules/aws-sdk/node_modules/punycode/punycode.js] 1:0-47
     cjs require module [./node_modules/rete-context-menu-plugin/node_modules/lodash/lodash.js] 1:0-47

And this is the way that Im applying the context menu to the editor:

this.editor.use(ContextMenuPlugin, {
            searchBar: false,
            delay: 100,
            allocate() {
                return ['Submenu']
            }
        });

Thank you in advance.

Ni55aN commented 5 years ago

I have reproduced it, but it doesn't affect menu itself. Seems like vue-loader (via rollup plugin) adding comment sourceMappingURL, but doesn't generate source map. Same things happens with vue-render-plugin

borja010 commented 5 years ago

But the node and sockets are not being affected. Do you if is there any way that can be fixed or a turn around?

Ni55aN commented 5 years ago

Node.vue and Socket.vue come from vue-render-plugin screenshot from 2019-01-10 23-11-53

Ni55aN commented 5 years ago

I think this problem related to rollup-plugin-vue or vue-loader since sourceMappingURL being added but separated source-map not created (instead code for .vue located in .min.js.map). I'll check it if I have free time

borja010 commented 5 years ago

But the Node.vue ad Socket.vue are not being affected. The only difference that I can see between the vue-loader from the vue-render and context-menu is 'lodash': '_'. Do you think that is related to that?

Ni55aN commented 5 years ago

Do you think that is related to that?

I don't think so. As I undestood the problem is browser trying to request .vue.map according to sourceMappingURL, and your server respond 404. Identically, for Menu.vue and Node.vue

borja010 commented 5 years ago

But if that is the case, why the nodes and sockets are being displayed :)

Ni55aN commented 5 years ago

In Angular example the context menu works correctly https://github.com/retejs/examples/tree/master/Angular

borja010 commented 5 years ago

Good evening,

I try on my project, the ng build and its working. The production building was not taking in consideration the sourcemap and thats why it was not showing.

Thank you for the assistance. Ill close this.