Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagesPath nor rootPath works #238

Open
VladyslavLukyanenko opened this issue Oct 2, 2019 · 4 comments
Open

pagesPath nor rootPath works #238

VladyslavLukyanenko opened this issue Oct 2, 2019 · 4 comments

Comments

@VladyslavLukyanenko
Copy link

@VladyslavLukyanenko VladyslavLukyanenko commented Oct 2, 2019

Description of Issue

console.log(path.join(__dirname, "/views/"))
const vueOptions = {
pagesPath: path.join(__dirname, "/views/")
};

expressVue.use(app, vueOptions).then(() => {
//CODE
});

Stack Trace / Console Log

(node:19805) UnhandledPromiseRejectionWarning: TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.parse (path.js:1516:5)
at Renderer.getBundleFilePath (/root/megogo/node_modules/vue-pronto/lib/renderer/renderer-webpack.js:221:33)
at Renderer._loadBundleFilesToMemory (/root/megogo/node_modules/vue-pronto/lib/renderer/renderer-webpack.js:202:37)
at Renderer.Bootstrap (/root/megogo/node_modules/vue-pronto/lib/renderer/renderer-webpack.js:151:32)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:19805) 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: 3)
(node:19805) [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.

Additional Comments

Logging the path outputs: /root/megogo/frontend/views/

@gmaragao
Copy link

@gmaragao gmaragao commented Mar 16, 2020

I'm having the same issue here.
How did you solve this? Actually my problem is that is always going to that vue-pronto folder instead of using my own path.

@hbkwong
Copy link

@hbkwong hbkwong commented Jul 15, 2020

@gmaragao Were you able to resolve the issue? I've been running into the same errors as well.

@gmaragao
Copy link

@gmaragao gmaragao commented Jul 15, 2020

hbkwong commented 24 minutes ago
@gmaragao Were you able to resolve the issue? I've been running into the same errors as well.

@hbkwong
No, I just made it different. Instead of serving a vue application using express I created a div with an app id and mounted it inside the vue instance (main.js).

<div id="app"></div> -- HTML file (could be one page rendered/served by your Node..js/Express application.

new Vue({ render: h => h(App) }).$mount('#app'); -- main.js (inside the vue.js folder structure)

My backend express/node application is in the same folder as the vue instance.

I hope it helps :)

@hbkwong
Copy link

@hbkwong hbkwong commented Jul 18, 2020

Nice! Pretty similar pattern you'd follow for a hook into which you'd insert a React component. Thanks for the heads up @gmaragao !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.