Bug when namespacing a scaffold

I set up a new project today and when I tried namespacing my scaffolds (yarn rw g scaffold admin/posts) this error popped up.

Failed to compile.

./src/Routes.js 1:11
Module parse failed: Unexpected token (1:11)
File was processed with these loaders:
 * ../node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
> const Admin/EditPostPage = {
|   name: "Admin/EditPostPage",
|   loader: () => import("C:\\Users\\trist\\Code\\Hivemind\\web\\src\\pages\\Admin\\EditPostPage\\EditPostPage")

I used the exact data from the tutorial (admin/post) and the same schema so I could properly test it, and the bug was still there.

After removing the namespace the error went away. Thought I should bring this up incase it hasn’t been noticed yet.

1 Like

I can confirm I get the same error. I wonder if it’s a Windows thing.

Support for namespacing scaffolds was added here Add path specification to scaffolds by jtoar · Pull Request #423 · redwoodjs/redwood · GitHub

@dom you wrote that PR, can you please check if this is still working for you?

I am getting the same issue. I am on Windows with V0.27.1 of redwood. I tried moving an existing set of scaffolded components and making the changes identified in the Routes.js comments, but get the same issue as Tris.

I did some testing this evening and I think I know where it is coming from. I just posted an issue in github:

BTW, thank you to the team and all your hard work. I love where the framework is going.

Hi all! I think this might need to become a GitHub Issue. Would you might creating one and loop in @dom (@jtoar on github)?

It would be helpful to know system/version info as well, which you can copy+past output from yarn redwood info. Thanks in advance!

Sure. I’ll post the result on GitHub.