{"action":"created","issue":{"url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/138","repository_url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack","labels_url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/138/comments","events_url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/138/events","html_url":"https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues/138","id":353800073,"node_id":"MDU6SXNzdWUzNTM4MDAwNzM=","number":138,"title":"Creating Multipage App with VueJS is not working","user":{"login":"mario-minati","id":1096532,"node_id":"MDQ6VXNlcjEwOTY1MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1096532?v=4","gravatar_id":"","url":"https://api.github.com/users/mario-minati","html_url":"https://github.com/mario-minati","followers_url":"https://api.github.com/users/mario-minati/followers","following_url":"https://api.github.com/users/mario-minati/following{/other_user}","gists_url":"https://api.github.com/users/mario-minati/gists{/gist_id}","starred_url":"https://api.github.com/users/mario-minati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mario-minati/subscriptions","organizations_url":"https://api.github.com/users/mario-minati/orgs","repos_url":"https://api.github.com/users/mario-minati/repos","events_url":"https://api.github.com/users/mario-minati/events{/privacy}","received_events_url":"https://api.github.com/users/mario-minati/received_events","type":"User","site_admin":false},"labels":[{"id":56430725,"node_id":"MDU6TGFiZWw1NjQzMDcyNQ==","url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"jhthorsen","id":45729,"node_id":"MDQ6VXNlcjQ1NzI5","avatar_url":"https://avatars2.githubusercontent.com/u/45729?v=4","gravatar_id":"","url":"https://api.github.com/users/jhthorsen","html_url":"https://github.com/jhthorsen","followers_url":"https://api.github.com/users/jhthorsen/followers","following_url":"https://api.github.com/users/jhthorsen/following{/other_user}","gists_url":"https://api.github.com/users/jhthorsen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhthorsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhthorsen/subscriptions","organizations_url":"https://api.github.com/users/jhthorsen/orgs","repos_url":"https://api.github.com/users/jhthorsen/repos","events_url":"https://api.github.com/users/jhthorsen/events{/privacy}","received_events_url":"https://api.github.com/users/jhthorsen/received_events","type":"User","site_admin":false},"assignees":[{"login":"jhthorsen","id":45729,"node_id":"MDQ6VXNlcjQ1NzI5","avatar_url":"https://avatars2.githubusercontent.com/u/45729?v=4","gravatar_id":"","url":"https://api.github.com/users/jhthorsen","html_url":"https://github.com/jhthorsen","followers_url":"https://api.github.com/users/jhthorsen/followers","following_url":"https://api.github.com/users/jhthorsen/following{/other_user}","gists_url":"https://api.github.com/users/jhthorsen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhthorsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhthorsen/subscriptions","organizations_url":"https://api.github.com/users/jhthorsen/orgs","repos_url":"https://api.github.com/users/jhthorsen/repos","events_url":"https://api.github.com/users/jhthorsen/events{/privacy}","received_events_url":"https://api.github.com/users/jhthorsen/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-08-24T14:10:57Z","updated_at":"2018-09-01T15:36:13Z","closed_at":null,"author_association":"NONE","body":"We are trying to create a multipage app with Mojolicious, VueJS and AssetPack using the RollupJS Pipe.\r\n\r\nThe startup code is working so far as expected:\r\n```\r\n  $self->plugin(AssetPack => {pipes => [qw(RollupJs)]});\r\n  $self->asset->store->paths([$self->home->rel_file('src')]);\r\n\r\n  # Add Vuejs as dependencies\r\n  push @{$self->asset->pipe('RollupJs')->modules}, 'vue';\r\n  unshift @{$self->asset->pipe('RollupJs')->plugins}, 'rollup-plugin-vue';\r\n\r\n  # Process app.js\r\n  $self->asset->process('app.js' => 'main.js');\r\n```\r\n\r\nThe main.js is somewhat straight forward:\r\n\r\n```\r\nimport 'core-js/es6/promise'\r\nimport 'core-js/es6/string'\r\nimport 'core-js/es7/array'\r\n\r\nimport Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport BootstrapVue from 'bootstrap-vue'\r\nimport router from './router'\r\nimport store from './store';\r\nimport App from './App'\r\nimport config from '@/shared/config'\r\n\r\nVue.config.productionTip = false;\r\n\r\nVue.use(BootstrapVue);\r\n\r\nnew Vue({\r\n  el: '#app',\r\n  router,\r\n  store,\r\n  template: '<App/>',\r\n  components: {\r\n    App\r\n  }\r\n})\r\n```\r\n\r\nStarting morbo leads to the following error:\r\n\r\n```\r\n/tmp/assetpack-rollup.js:22\r\n  plugins: [plugin_rollup_plugin_vue(),plugin_rollup_plugin_node_resolve(),plugin_rollup_plugin_commonjs()]\r\n            ^\r\n\r\nTypeError: plugin_rollup_plugin_vue is not a function\r\n    at Object.<anonymous> (/tmp/assetpack-rollup.js:22:13)\r\n    at Module._compile (internal/modules/cjs/loader.js:689:30)\r\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\r\n    at Module.load (internal/modules/cjs/loader.js:599:32)\r\n    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\r\n    at Function.Module._load (internal/modules/cjs/loader.js:530:3)\r\n    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)\r\n    at startup (internal/bootstrap/node.js:266:19)\r\n    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)\r\n```\r\n\r\nWhile trying to find out what the reason is, we stumbled upon an unexpected return value in the nodejs code generated from RollupJS. \r\n\r\n`    push @import,  \"var $func = require('$plugin');\\n\";`\r\n\r\nThis returns an Object:\r\n\r\n`{ default: [Function: VuePlugin] }`\r\n\r\nAfter adding some fixing code to RollupJS\r\n\r\n`    push @import,  \"if (typeof $func == 'object') {$func = $func.default};\\n\";`\r\n\r\nWe still cannot sucessfully run the code:\r\n\r\n```\r\n(node:4216) UnhandledPromiseRejectionWarning: Error: Could not resolve './App' from src/main.js\r\n    at error (/home/glue/src/glue-frontend/node_modules/rollup/dist/rollup.js:3365:15)\r\n    at /home/glue/src/glue-frontend/node_modules/rollup/dist/rollup.js:21504:25\r\n(node:4216) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)\r\n(node:4216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\r\n```\r\n\r\nThe not found file './App' is there, is it named 'App.vue'. What has to be done, that '*.vue'-files are handled appropriatly?"},"comment":{"url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/comments/417867465","html_url":"https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues/138#issuecomment-417867465","issue_url":"https://api.github.com/repos/jhthorsen/mojolicious-plugin-assetpack/issues/138","id":417867465,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzg2NzQ2NQ==","user":{"login":"jhthorsen","id":45729,"node_id":"MDQ6VXNlcjQ1NzI5","avatar_url":"https://avatars2.githubusercontent.com/u/45729?v=4","gravatar_id":"","url":"https://api.github.com/users/jhthorsen","html_url":"https://github.com/jhthorsen","followers_url":"https://api.github.com/users/jhthorsen/followers","following_url":"https://api.github.com/users/jhthorsen/following{/other_user}","gists_url":"https://api.github.com/users/jhthorsen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhthorsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhthorsen/subscriptions","organizations_url":"https://api.github.com/users/jhthorsen/orgs","repos_url":"https://api.github.com/users/jhthorsen/repos","events_url":"https://api.github.com/users/jhthorsen/events{/privacy}","received_events_url":"https://api.github.com/users/jhthorsen/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T15:36:13Z","updated_at":"2018-09-01T15:36:13Z","author_association":"OWNER","body":"That might be... I thought I had cleaned up my node_modules, but I have to look at it again.\r\n\r\nHopefully get back to you tomorrow or on Monday."}}
{"actor":{"display_login":"jhthorsen"}}