Git Product home page Git Product logo

Comments (23)

luismendoza-ec avatar luismendoza-ec commented on June 12, 2024 3

As a workaround, adding @strapi/email as an explicit dependency in package.json seems to fix it.

Thanks! I tried this, but now getting the following error (image attached).
image

Using:
Node v20.9.0
NPM 10.1.0

from strapi.

Jank1310 avatar Jank1310 commented on June 12, 2024 2

As a workaround, adding @strapi/email as an explicit dependency in package.json seems to fix it.

Thanks! I tried this, but now getting the following error (image attached). image

Using: Node v20.9.0 NPM 10.1.0

Did you try to add 5.0.0-beta.8 release of @strapi/email, it works for me

from strapi.

joshuaellis avatar joshuaellis commented on June 12, 2024 1

The issue comes from the fact that only @strapi/strapi has @strapi/email listed as a dependency, but @strapi/core tries to load it dynamically without having it listed as a dependency, this will most likely break pnpm anyway.

@alexandrebodin || @innerdvations I think it's worth reviewing how plugins are loaded by strapi/core because whilst the immediate fix would be to add @strapi/email to the list of deps in @strapi/core I think it's a brittle solution considering that the package wants to load deps it doesn't know about and thus relies on package manager implementation which as we can see is subject to break. Made a loom to demonstrate the issue https://www.loom.com/share/a75b25cbed004b829d3df761bcef7a1e?sid=219dcfa1-79ec-4a2b-aa9f-5807c4fe4871

from strapi.

LuisRodriguezLD avatar LuisRodriguezLD commented on June 12, 2024 1

Thanks for looking into this @Convly
However, wouldn't it make sense to add this .npmrc file as part of the initial template?
I feel this could make life easier for devs who just want to try Strapi without needing to dig into why it's randomly failing

I'm happy to work on this if you think is a good idea.

from strapi.

Convly avatar Convly commented on June 12, 2024 1

On that note, while our criterion mandates us to have it as low on GitHub (for good reasons), we bumped it to medium in our internal team's backlog as we want to get it done as soon as we can

from strapi.

corvallo avatar corvallo commented on June 12, 2024

I manage to solve by installing manually @strapi/[email protected]

from strapi.

joshuaellis avatar joshuaellis commented on June 12, 2024

@rbjs can you run npm ls @strapi/email and share the output please?

from strapi.

github-actions avatar github-actions commented on June 12, 2024

This is a templated message

Hello @rbjs,

Thank you for reporting this bug, however we are unable to reproduce the issue you described given the information we have on hand. Can you please create a fresh project that you are able to reproduce the issue in, provide clear steps to reproduce this issue, and either upload this fresh project to a new GitHub repo or compress it into a .zip and upload it on this issue?

We would greatly appreciate your assistance with this, by working in a fresh project it will cut out any possible variables that might be unrelated.
Please note that issues labeled with status: can not reproduce will be closed in 14 days if there is no activity.

Thank you!

from strapi.

LuisRodriguezLD avatar LuisRodriguezLD commented on June 12, 2024

Usually I don't write comments like 'same here' but I'm also seeing this and I can provide more input.

Same env as OP but:

  • Using TS
  • Using SQLite

Running npm ls @strapi/email yields

[email protected] /Users/user/dev/project
└─┬ @strapi/[email protected]
  └── @strapi/[email protected]

The file requiring this package is here -> https://github.com/strapi/strapi/blob/v5.0.0-beta.7/packages/core/core/src/loaders/plugins/get-enabled-plugins.ts

Let me know if you have additional questions

from strapi.

joshuaellis avatar joshuaellis commented on June 12, 2024

Thanks @LuisRodriguezLD, what package manager are you using? 😊

EDIT: and node version?

from strapi.

LuisRodriguezLD avatar LuisRodriguezLD commented on June 12, 2024

NPM 10.5.0
NODE 20.12.1

from strapi.

lerry avatar lerry commented on June 12, 2024

I have the same issue.
Node.js version: v20.13.1
NPM version: 10.5.2
Strapi version: 5.0.0-beta.7
Database: postgresql
Operating system: Debian 12
Is your project Javascript or Typescript: Typescript

from strapi.

lunatiqqc avatar lunatiqqc commented on June 12, 2024

"yarn install" instead of "npm install" fixes it for me

from strapi.

Convly avatar Convly commented on June 12, 2024

I managed to reproduce it locally.

From what I've found, it comes down to hoisting settings:

  • if hoisting is enabled, no issue arise
  • if you add hoist=false to your project .npmrc (or disable hoisting globally), then dependency errors arise.

Note: This is something that also happen on v4 since its launch.

This is still a valid issue as package managers are slowly going toward "no hoisting by default" and we're definitely going to work on it, but we've decided to lower the priority as it's not a regression and has a straightforward workaround.

from strapi.

Convly avatar Convly commented on June 12, 2024

Hey @LuisRodriguezLD !

Thanks for your input. We've talked about your proposal internally and concluded that we would rather fix the bug directly rather than add a temporary workaround for the beta. Adding more configuration for default apps for such a niche issue feels a bit too much for us.

One thing that we can do though, is to add some troubleshooting into the documentation with a clear explanation of what's happening and how to solve it.

We'll add the development of a fix for this issue on our current backlog and try to deliver a satisfying solution asap.

What do you think?

Also, to be sure, can you confirm that adding hoist=false in your app's config fixed the issue?

from strapi.

LuisRodriguezLD avatar LuisRodriguezLD commented on June 12, 2024

Understandable.
Please note I have been unsuccessfully in having it work with npm 10.5 as it currently lacks the option to set hoisting settings. There is an install strategy but I've tried all options with no success.

Hoisting config exists in pnpm and yarn but is still a RFC in npm
There is a way to trick npm but it doesn't feel right

That being said, would you guys considering updating the severity to medium?

from strapi.

derrickmehaffy avatar derrickmehaffy commented on June 12, 2024

If there is a valid workaround to the issue then we leave it at low. In this case the workaround is to use that config, downgrade your npm version, or use an alternative like yarn.

That's why it remains at low for now.

from strapi.

mirkonasato avatar mirkonasato commented on June 12, 2024

From what I've found, it comes down to hoisting settings:

  • if hoisting is enabled, no issue arise
  • if you add hoist=false to your project .npmrc (or disable hoisting globally), then dependency errors arise.

Note: This is something that also happen on v4 since its launch.

I never encountered and still don't see this problem with v4. I only got it when trying v5 for the first time right now.

This is using the Node v20.13.1 and npm 10.8.0 for both v4 and v5, and I don't have any custom .npmrc settings. Edit: install-strategy defaults to hoisted anyway.

from strapi.

mirkonasato avatar mirkonasato commented on June 12, 2024

As a workaround, adding @strapi/email as an explicit dependency in package.json seems to fix it.

from strapi.

imdimasan avatar imdimasan commented on June 12, 2024

The same error occured.
Win11
NPM 10.5.2
NODE 20.13.1

from strapi.

yusuf-saydullayev avatar yusuf-saydullayev commented on June 12, 2024

The same error occured.
Win11
NPM 10.8.0
NODE 20.13.1
Strapi version: 5.0.0-beta.8 release

from strapi.

luismendoza-ec avatar luismendoza-ec commented on June 12, 2024

As a workaround, adding @strapi/email as an explicit dependency in package.json seems to fix it.

Thanks! I tried this, but now getting the following error (image attached). image
Using: Node v20.9.0 NPM 10.1.0

Did you try to add 5.0.0-beta.8 release of @strapi/email, it works for me

Yes, thanks! that worked for me

from strapi.

folt3k avatar folt3k commented on June 12, 2024

I had same issue and adding "@strapi/email": "5.0.0-beta.8" in packege.json fixed it.

from strapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.