question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fatal issue possibly due to vite-plugin-ssr@0.4.59

See original GitHub issue

Description

After trying to upgrade from v0.4.44 to vite-plugin-ssr@0.4.59 my app fails both in development and production mode. See stack trace below.

Relevant dependencies of my app:

  • node@16
  • vue@3.2.25
  • vite@3.2.0
  • vite-plugin-ssr@0.4.59
  • vite-plugin-environment@1.1.2
  • vite-plugin-vuetify@1.0.1
  • express@4.18.1
  • vuetify@3.0.3
  • typescript@4.7.4
  • vue-tsc@1.0.9

The first version I can successfully upgrade to is v0.4.54.

Relevant part of my vite.config.ts:

export default defineConfig(({ mode }) => {
  return {
    base: 'https://www.example.com/',
    plugins: [
      ssr()
      // etc
    ]
    // other config options
    // ...
  }
})

Error Message + Error Stack

root@3bef86e36412:/home/node# yarn dev
yarn run v1.22.19
$ yarn run server
$ ts-node ./server
/home/node/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/baseUrls.js:35
            (0, utils_1.assert)(configVps.baseAssets === baseAssets);
                               ^
Error: [vite-plugin-ssr@0.4.59][Bug] You stumbled upon a bug in vite-plugin-ssr's source code. Reach out at https://github.com/brillout/vite-plugin-ssr/issues/new or https://discord.com/invite/qTq92FQzKb and include this error stack (the error stack is usually enough to fix the problem). A maintainer will fix the bug (usually under 24 hours). Don't hesitate to reach out as it makes vite-plugin-ssr more robust.
    at configResolved (/home/node/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/baseUrls.js:35:32)
    at async Promise.all (index 12)
    at async resolveConfig (file:///home/node/node_modules/vite/dist/node/chunks/dep-61d2428a.js:65483:5)
    at async Module.createServer (file:///home/node/node_modules/vite/dist/node/chunks/dep-61d2428a.js:64547:20)
    at async initVite (file:///home/node/server/index.ts:95:21)
    at async startServer (file:///home/node/server/index.ts:64:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Dec 15, 2022

Just released (0.4.61) a fix for the assetsDir issue. I didn’t test it but it should work. Let me know if it doesn’t.

Even after using the default assetsDir when I add back the asserts to baseUrls.ts, the original failure is back, so I am still working on a minimal reproduction.

I’m looking forward to the minimal reproduction.

1reaction
brilloutcommented, Dec 14, 2022

You can use one of the examples/base-url*. Most notably the examples/base-url-cdn is prob a good start.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found