You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit: I overlooked the fact that the scaffold generator created .jsx files, which are not picked up by the resolve() method when inertia-rails is configured to use Typescript. The actual issue is that the scaffold generator should create .tsx files, with Typescript inside if possible.
and I can see all the files being created in the right place, and a the resources :articles added to routes.rb
I can confirm I can load Articles from the resource on the console with Article.limit(10) for example.
But when I try to access /articles in the browser, instead of the expected React component showing the list of articles, I get a blank page with an error in the console:
Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'y.default') in createInertiaApp.ts:85
I have not changed or added any files myself, I am using a fresh Rails install, a fresh inertia-rails install, and an unchanged scaffold from inertia-rails.
The text was updated successfully, but these errors were encountered:
Edit: I overlooked the fact that the scaffold generator created .jsx files, which are not picked up by the resolve() method when inertia-rails is configured to use Typescript. The actual issue is that the scaffold generator should create .tsx files, with Typescript inside if possible.
Previous issue text:
I have created a new Rails 8.0 app, and installed inertia-rails following the instructions at https://inertia-rails.dev/guide/server-side-setup#rails-generator.
I can run the app, navigate to /inertia-example, and it works without any errors in the console (great!).
But, then I created an inertia-rails scaffold with
bundle exec bin/rails generate inertia:scaffold Article sku:string title:string
and I can see all the files being created in the right place, and a the
resources :articles
added to routes.rbI can confirm I can load Articles from the resource on the console with
Article.limit(10)
for example.But when I try to access /articles in the browser, instead of the expected React component showing the list of articles, I get a blank page with an error in the console:
This is the code at createInertiaApp.ts, line 85:
I have not changed or added any files myself, I am using a fresh Rails install, a fresh inertia-rails install, and an unchanged scaffold from inertia-rails.
The text was updated successfully, but these errors were encountered: