Skip to content

router-link doesn't render when in production #361

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

Closed
jwoertink opened this issue Dec 16, 2021 · 4 comments
Closed

router-link doesn't render when in production #361

jwoertink opened this issue Dec 16, 2021 · 4 comments

Comments

@jwoertink
Copy link

jwoertink commented Dec 16, 2021

Yeah... it's a weird edge case. Maybe related to #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!

@LinusBorg
Copy link
Owner

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.

@jwoertink
Copy link
Author

I'll see if I can get a little sandbox example going.

@jwoertink
Copy link
Author

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.

@LinusBorg
Copy link
Owner

I'll close this as inactive. Can't do much without a way to reproduce the problem

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

No branches or pull requests

2 participants