Inertia: Error loading `inertia-svelte` under Rails (via webpacker)

Created on 26 Oct 2020  ·  5Comments  ·  Source: inertiajs/inertia

8:34:16 PM webpack.1 |  Version: webpack 4.44.2
8:34:16 PM webpack.1 |  Time: 3899ms
8:34:16 PM webpack.1 |  Built at: 10/25/2020 8:34:15 PM
8:34:16 PM webpack.1 |                                                     Asset       Size       Chunks                         Chunk Names
8:34:16 PM webpack.1 |                       application-141aa79e56d42feb82ca.js    986 KiB  application  [emitted] [immutable]  application
8:34:16 PM webpack.1 |                   application-141aa79e56d42feb82ca.js.map   1.02 MiB  application  [emitted] [dev]        application
8:34:16 PM webpack.1 |                            client-141aa79e56d42feb82ca.js    654 KiB       client  [emitted] [immutable]  client
8:34:16 PM webpack.1 |                        client-141aa79e56d42feb82ca.js.map    674 KiB       client  [emitted] [dev]        client
8:34:16 PM webpack.1 |                                             manifest.json  832 bytes               [emitted]              
8:34:16 PM webpack.1 |  media/images/banner-5f539d39241aceb17c07bbaa6e611cac.svg   16.2 KiB               [emitted]              
8:34:16 PM webpack.1 |    media/images/icon-03960d2ed0f0c47a77a9fbf21ddf798f.svg   2.71 KiB               [emitted]              
8:34:16 PM webpack.1 |  ERROR in ./node_modules/@inertiajs/inertia-svelte/src/index.js
8:34:16 PM webpack.1 |  Module not found: Error: [CaseSensitivePathsPlugin] `/Users/jason/Projects/gateway/node_modules/@inertiajs/inertia-svelte/src/link.svelte` does not match the corresponding path on disk `Link.svelte`.
8:34:16 PM webpack.1 |  ℹ 「wdm」: Failed to compile.

I followed the instructions in the Inertia docs, and couldn't get past this issue. I believe it has to do with webpack being confused while loading both Link.svelte and link.js. My app has a fairly vanilla setup, but I will try to reproduce it in a empty rails app.

investigate svelte

Most helpful comment

I also have this issue. My temporary solution is rewrite these line
export { default as inertia } from './link' in node_modules/@inertiajs/inertia-svelte/src/index.js
to
export { default as inertia } from './link.js'

All 5 comments

Here's a minimal example app that demonstrates the problem:

https://github.com/ambethia/sit-demo/blob/master/app/javascript/packs/application.js

All I did was generate the app, install svelte and inertia with a simple model/controller.

I also have this issue. My temporary solution is rewrite these line
export { default as inertia } from './link' in node_modules/@inertiajs/inertia-svelte/src/index.js
to
export { default as inertia } from './link.js'

Oh, thanks @norazlan!

In version 0.6.0 of @inertia/inertia-svelte the problem still exists, when are you going to fix this?

This should be fixed in #529, which we hope to release soon. 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philippkuehn picture philippkuehn  ·  3Comments

sebastiandedeyne picture sebastiandedeyne  ·  3Comments

piercemcgeough picture piercemcgeough  ·  4Comments

TimVanHerwijnen picture TimVanHerwijnen  ·  5Comments

mpskovvang picture mpskovvang  ·  5Comments