portal-vue
portal-vue copied to clipboard
router-link doesn't render when in production
Yeah... it's a weird edge case. Maybe related to https://github.com/LinusBorg/portal-vue/issues/289 ?
Basically, I have this:
<portal to="subNavigation">
<div class="sub-navigation">
<router-link :to="{ name: 'NewPost' }" class="button">
Create New Post
</router-link>
</div>
</portal>
<portal-target name="subNavigation" slim />
When I run my yarn dev, everything is great. When I run my yarn prod, the router-link doesn't render... However, I can put a normal <button> in and it works fine in production.
For reference, here's my package.json build scripts:
"dev": "yarn run webpack --progress --hide-modules --color --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "NODE_ENV=production yarn run webpack --progress --hide-modules --color --config=node_modules/laravel-mix/setup/webpack.config.js"
I don't have a way to make a smaller example, but I can test anything you need. Let me know.
Thanks!
Would be helpful to have a runnable example of that code that does reproduce the problem, I'll need to look at what is actually rendered.
I'll see if I can get a little sandbox example going.
oh, and to add to it, it seems that slim also has to be there 🤔 but removing slim also throws this unhelpful error:
TypeError: n is undefined
render http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
render http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
Se http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
render http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
_render http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
a http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
get http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
fn http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
exports http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
$mount http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
$mount http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
init http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
d http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
d http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
C http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
d http://localhost:5000/js/main.js?id=50b0da5cc527ece8424d:1
I'm still doing more investigating to see if I can narrow it down a bit more.
I'll close this as inactive. Can't do much without a way to reproduce the problem