Studio replacing Lab

I got the same behaviour.

Do you have a node_modules folder in sites/studio and if so, can you remove it and try to start the studio again?

FYI: this is a webpack doesn’t have a JSX loader situation, in case people are curious

Yes, it worked, thank you. I ran rm -rf sites/studio/node_modules and npm run studio, and the studio is now running properly in my browser.

In case anyone was wondering what the Studio looks like, the initial experience is about the same with Standalone vs. Repository:

Standalone Studio:

Repository Studio:

1 Like

Current issues with the repository studio:

  • After npm run kickstart or npm run reconfigure, npm run studio will result in compile errors. Need to run rm -rf sites/studio/node_modules.
  • The repository studio incorrectly says the command to add a new design npm run add design. Instead the correct command is npm run add.
  • The npm run add interactive script incorrectly asks to select a template to use. Instead, the script always just installs the “from scratch” box template, so it shouldn’t provide you with the choice.
  • npm run add does not add an about.json file for the new design. As a result, one gets generated, but it is missing the “id”. As a result, in package.json, the “name” is set to “@freesewing/undefined”.
  • Due to another bug, plugin-theme is also defined with a “name” of “@freesewing/undefined”. As a result, npm run studio then fails because there are 2 “@freesewing/undefined” packages.
  • As a result of previous issues, no symlink gets created in node_modules/@freesewing for the new design, requiring another kickstart.
  • npm run add installs old v3 code for the new design that uses the now-removed data.mjs file. As a result, npm run kickstart fails with ERR_MODULE_NOT_FOUND.

The steps to work around the issues and get the repository studio running with a new design:

  1. npm run kickstart
  2. rm -rf sites/studio/node_modules
  3. npm run studio (just to verify that the repository studio is working, before trying to add a new design). (Halt the repository studio.)
  4. npm run add and add the new design.
  5. Edit plugins/plugin-theme/package.json and change @freesewing/undefined to @freesewing/plugin-theme
  6. Edit plugins/plugin-theme/about.json and change "name" to "id".
  7. Edit designs/<design_name>/package.json and change @freesewing/undefined to @freesewing/<design_name>.
  8. Edit designs/<design_name>/about.json and add "id": "<design_name>",
  9. Edit designs/<design_name</src/index.mjs, and change the import { data } from '../data.mjs' line to import about from '../about.json' with { type: 'json' }, and change data, to data: about,, and add about to the list of named exports.
  10. npm run kickstart
  11. rm -rf sites/studio/node_modules
  12. npm run studio
1 Like

This is great summary @Benjamin_F thanks so much :folded_hands:

(as far as I know) All of the issues you mentioned above are resolved now:

  • The JSX issue and the local node_modules folder were caused by how we configured the dependencies inside the workspace. I have fixed that, so there’s no need to remove that folder (sorry for closing the PR that added that)
  • The fact that now about.json was generated, and that the template you selected was ignored, was because it was using the old v3 template, rather than the new v4 template
  • I’ve updated the content in the monorepo studio to display the correct command

Essentially, everything should be ok now.