Hi. Followed the excellent getting started guide creating posts. This was ver. 0.7.0. I want to use RWjs for an existing database so I created a new project, ran db introspect and save and created a homepage using ‘yarn rw g page home /’. But that fails with the ‘ReferenceError: HomePage is not defined’ and then identifies the offending line:
Hi @kometen Thanks for taking a dive into Redwood! Let’s see if we can get things back on track – this is strange behavior indeed.
We’ll need your system info. Could you paste the info in a reply from runningyarn rw info?
Quick potential fix: did you try stop/starting the dev-server? I ran into something yesterday that feels suspiciously similar and had to restart.
If that doesn’t work, we’d need to see some code snippets or even a link to a repo to try and reproduce. So maybe an overview of your Routes.js and a screenshot of your web/src/ dir structure down to HomePage.js?
I am experiencing the same issue. I haven’t started writing any of my own code, and am experiencing this on the first step of the intro tutorial. Running yarn rw info returns:
@peterp If it helps any: it seems to work fine if I import the HomePage manually. Oddly, secondary routes (e.g., AboutPage) start working without having to be manually imported when that HomePage route is imported.
Thank you for your response. Yes, I did restart the dev-server. As @cbmunro also mentions it seemed to work when another route was added using “yarn rw g page foo”. But that seemed inconsistent.
So I ended up creating a project from scratch and downgrade to 0.7.0.
I just tried to update to v0.8.1 and this issue is still present.
I also just tried to “downgrade” by using yarn create redwood-app@0.7.0 redwoodblog and I get the following errors:
yarn create v1.22.4
[1/4] Resolving packages...
Couldn't find any versions for "create-redwood-app" that matches "0.7.1"
? Please choose a version of "create-redwood-app" from this list: 0.7.0-canary.0
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-redwood-app@0.7.0-canary.0" with binaries:
- create-redwood-app
/bin/sh: 1: /home/davidrhoderick/.yarn/bin/create-redwood-app@0.7.1: not found
error Command failed.
Exit code: 127
Command: /home/davidrhoderick/.yarn/bin/create-redwood-app@0.7.1
Arguments: redwoodblog
Directory: /home/davidrhoderick/Development/redwoodjs-tutorial
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Thank you for the work. I just tried a clean install on 0.8.1 and that works. Adding a page is OK. Removing the same page does not seems to delete the generated files and folders. Adding the pages table and chair and removing them again “yarn rw (g / d) page furniture” keeps routes and relevant files.
The upgrade-process is smooth.
Adding the page unit (yarn rw g page unit) works. But adding the page test fails. So does chair, table.