Skip to content

Use $views alias to import MyComponent#1

Open
floehopper wants to merge 2 commits intomainfrom
issue-using-views-alias
Open

Use $views alias to import MyComponent#1
floehopper wants to merge 2 commits intomainfrom
issue-using-views-alias

Conversation

@floehopper
Copy link
Copy Markdown
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