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

Can't find module laravel-vite-plugin/inertia-helpers.js in SSR #93

Closed
daleweaver777 opened this issue Jul 19, 2022 · 1 comment · Fixed by #95
Closed

Can't find module laravel-vite-plugin/inertia-helpers.js in SSR #93

daleweaver777 opened this issue Jul 19, 2022 · 1 comment · Fixed by #95

Comments

@daleweaver777
Copy link

  • Laravel Vite Plugin Version: 0.5.0
  • Laravel Version: 9.21.0
  • Node Version: 18.6.0
  • NPM Version: 8.13.2
  • Host operating system: macOS 12.4
  • Web Browser & Version: Firefox 103.0b9
  • Running in Sail / Docker: No

Description:

Installed the latest version of Laravel, installed latest version of Breeze with SSR, then ran npm run build. Everything built fine, but when running node bootstrap/ssr/ssr.mjs I get an error Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/dalew/code/php/laravel-test/node_modules/laravel-vite-plugin/inertia-helpers.js' imported from /Users/dalew/code/php/laravel-test/bootstrap/ssr/ssr.mjs

Steps To Reproduce:

  1. laravel new test-app
  2. composer require laravel/breeze --dev
  3. php artisan breeze:install vue --ssr
  4. npm install
  5. npm run build
  6. node bootstrap/ssr/ssr.mjs
@timacdonald
Copy link
Member

This is addressed in #95.

For a temporary fix until this fix is tagged and released, you may do the following in your vite.config.js:

export default defineConfig({
    // ...
    ssr: {
        noExternal: [
+           'laravel-vite-plugin',
            '@inertiajs/server',
        ],
    },
});

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

Successfully merging a pull request may close this issue.

2 participants