Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: When creating a new plugin (javascript) Strapi tries to look for a dist directory when there shouldn't be one #33

Closed
derrickmehaffy opened this issue Aug 5, 2024 · 5 comments · Fixed by #38
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@derrickmehaffy
Copy link
Member

derrickmehaffy commented Aug 5, 2024

What version of @strapi/blocks-react-renderer are you using?

$ strapi report --all
Launched In: 324 ms
Environment: development
OS: linux-x64
Strapi Version: 5.0.0-rc.8
Node/Yarn Version: yarn/1.22.22 npm/? node/v20.11.1 linux x64
Edition: Community
Database: sqlite
UUID: be5a4b93-531e-4dd9-8b6f-0ed0dc911441
Dependencies: {
  "@strapi/strapi": "5.0.0-rc.8",
  "@strapi/plugin-users-permissions": "5.0.0-rc.8",
  "@strapi/plugin-cloud": "5.0.0-rc.8",
  "react": "^18.0.0",
  "react-dom": "^18.0.0",
  "react-router-dom": "^6.0.0",
  "styled-components": "^6.0.0",
  "better-sqlite3": "9.4.3"
}
Dev Dependencies: {}
[2024-08-05 09:47:13.517] info: Shutting down Strapi
[2024-08-05 09:47:13.520] info: Strapi has been shut down
Done in 1.80s.

What's Wrong?

When creating a new javascript plugin (and installing plugin modules + configuring plugin in the project Strapi will try to load the plugin looking for ./dist/server directory when one should not exist since it's javascript, not typescript.

image

To Reproduce

Expected Behaviour

Strapi should detect if it's a typescript or javascript project and load the plugin as needed if it's javascript

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug status: confirmed Confirmed by a Strapi Team member or multiple community members severity: high If it breaks the basic use of the product labels Aug 5, 2024
@derrickmehaffy derrickmehaffy moved this from To triage to Backlog in Strapi 5 - Bug Tracker Aug 5, 2024
@innerdvations
Copy link
Collaborator

I'm fairly certain this is intended; even javascript projects need to be built with @strapi/pack-up

I will confirm, and then add the auto-build feature and double-check that the documentation is clear on that before closing this though.

@derrickmehaffy
Copy link
Member Author

If that's what should be done, does the default build command in new packages use packup?

@innerdvations
Copy link
Collaborator

innerdvations commented Aug 9, 2024

Yeah, you just have to run yarn build or yarn watch in the plugin directory. If you do that, it gets the same error as Typescript projects which is what I'm working on today.

@innerdvations
Copy link
Collaborator

Ok, I've done a bit more research and it doesn't seem there's any real reason to build it, so I'm not exactly sure why it's doing that. I'll experiment with just loading it directly.

@innerdvations
Copy link
Collaborator

I've confirmed that even javascript plugins need to be built, both for the admin and to ensure they build for both ESM and commonjs.

However, javascript plugins were not building the server correctly, which I've fixed in #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants