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

Use $views alias to import MyComponent #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

floehopper
Copy link
Member

I see the following error when viewing the home page:

Started GET "/" for 127.0.0.1 at 2024-09-20 12:49:08 +0100
Processing by HomeController#show as HTML
  Rendering layout layouts/application.html.erb
  Rendering home/show.html.svelte within layouts/application
✘ [ERROR] Could not resolve "$views/home/MyComponent.html.svelte"

    app/views/home/show.html.svelte:9:24:
      9 │ import MyComponent from "$views/home/MyComponent.html.svelte";
        ╵                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "$views/home/MyComponent.html.svelte" as external to exclude it from the
  bundle, which will remove this error and leave the unresolved path in the bundle.

  Rendered home/show.html.svelte within layouts/application (Duration: 460.6ms | GC: 0.0ms)
  Rendered layout layouts/application.html.erb (Duration: 460.8ms | GC: 0.0ms)
Completed 500 Internal Server Error in 463ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.1ms)

ActionView::Template::Error (undefined method `dig' for nil:NilClass):

Causes:
NoMethodError (undefined method `dig' for nil:NilClass)

app/views/home/show.html.svelte:32:in `new'
app/views/home/show.html.svelte:32

I see the following error when viewing the home page:

    Started GET "/" for 127.0.0.1 at 2024-09-20 12:49:08 +0100
    Processing by HomeController#show as HTML
      Rendering layout layouts/application.html.erb
      Rendering home/show.html.svelte within layouts/application
    ✘ [ERROR] Could not resolve "$views/home/MyComponent.html.svelte"

        app/views/home/show.html.svelte:9:24:
          9 │ import MyComponent from "$views/home/MyComponent.html.svelte";
            ╵                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      You can mark the path "$views/home/MyComponent.html.svelte" as external to exclude it from the
      bundle, which will remove this error and leave the unresolved path in the bundle.

      Rendered home/show.html.svelte within layouts/application (Duration: 460.6ms | GC: 0.0ms)
      Rendered layout layouts/application.html.erb (Duration: 460.8ms | GC: 0.0ms)
    Completed 500 Internal Server Error in 463ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.1ms)

    ActionView::Template::Error (undefined method `dig' for nil:NilClass):

    Causes:
    NoMethodError (undefined method `dig' for nil:NilClass)

    app/views/home/show.html.svelte:32:in `new'
    app/views/home/show.html.svelte:32
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 this pull request may close these issues.

1 participant