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

Fatal issue with deps ordering in package.json #209

Open
sneko opened this issue Jun 28, 2020 · 1 comment
Open

Fatal issue with deps ordering in package.json #209

sneko opened this issue Jun 28, 2020 · 1 comment

Comments

@sneko
Copy link

sneko commented Jun 28, 2020

Hi @Akryum ,

I'm using your plugin since a long time and decided to upgrade to fix lot of workarounds I put on. I'm now on the v0.6.0 but each time I try to reach a page I get:

  App running at:
  - Local:   http://localhost:8000/ (copied to clipboard)
[21:02:04] Server listening on localhost:8000
error during render url : /
Error: bundle export should be a function when using { runInNewContext: false }.
    at /Users/XXXXXXXXX/Documents/tests/aaa/node_modules/vue-server-renderer/build.dev.js:9381:17
    at new Promise (<anonymous>)
    at /Users/XXXXXXXXX/Documents/tests/aaa/node_modules/vue-server-renderer/build.dev.js:9368:14
    at Object.renderToString (/Users/XXXXXXXXX/Documents/tests/aaa/node_modules/vue-server-renderer/build.dev.js:9544:9)
    at renderApp (/Users/XXXXXXXXX/Documents/tests/aaa/node_modules/@akryum/vue-cli-plugin-ssr/lib/app.js:123:16)
    at /Users/XXXXXXXXX/Documents/tests/aaa/node_modules/@akryum/vue-cli-plugin-ssr/lib/app.js:172:33

After spending a while on this error I succeeded making working. For this I need to put in the package.json your plugin below the @vue/cli-plugin-typescript like this:

...
    "@vue/cli-plugin-typescript": "~4.4.0",
    "@akryum/vue-cli-plugin-ssr": "~0.6.0",
...

In case I put yours at the top of its object (due to alphabetical ordering done automatically), this simply breaks 😭

I always thought the package.json ordering was not mattering. But it seems it does 🤔

If you have any idea, I would really appreciate 👍

Thank you,

EDIT: note that I also tried with a project from scratch by doing

vue create aaa
vue add router
vue add @akryum/ssr

if I test it works!
But then if I add:

vue add typescript

Then it breaks as described, except if I manually switch the deps order in package.json 😞

EDIT2: since for each yarn install/upgrade... it will break the "workaround", I decided to move your plugin in the "dependencies" object as follow:

{
  ...
  "dependencies": {
    "@akryum/vue-cli-plugin-ssr": "~0.6.0",
    ...
  },
  "devDependencies": {
    ...
    "@vue/cli-plugin-e2e-nightwatch": "~4.4.0",
    "@vue/cli-plugin-pwa": "~4.4.0",
    "@vue/cli-plugin-router": "~4.4.0",
    "@vue/cli-plugin-typescript": "~4.4.0",
    "@vue/cli-plugin-unit-jest": "~4.4.0",
    ...
  },
}

in this case the auto-sorting won't break the workaround.

It's for sure not a long-term solution, I really hope someone has some insights about this 👍

@bgondy
Copy link

bgondy commented Aug 12, 2020

Same here.

@sneko Your workaround does the job. Thanks for sharing.

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