boxyhq / jackson

🔥 Streamline your web application's authentication with Jackson, an SSO service supporting SAML and OpenID Connect protocols. Beyond enterprise-grade Single Sign-On, it also supports Directory Sync via the SCIM 2.0 protocol for automatic user and group provisioning/de-provisioning. 🤩
https://boxyhq.com/docs/jackson/overview
Apache License 2.0
1.81k stars 155 forks source link

Webpack (next.js): Critical dependency: the request of a dependency is an expression #2909

Closed Ziothh closed 2 months ago

Ziothh commented 3 months ago

Issue Summary

When switching the package manager of my monorepo from npm to pnpm I get this new error:

After a few hours of googling I had to park this issue. So I'm trying my luck here. Any help would be greatly appreciated!

 ⚠ ../../node_modules/.pnpm/@boxyhq+saml-jackson@1.26.7_@aws-sdk+client-sso-oidc@3.609.0/node_modules/@boxyhq/saml-jackson/dist/loadConnection.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
../../node_modules/.pnpm/@boxyhq+saml-jackson@1.26.7_@aws-sdk+client-sso-oidc@3.609.0/node_modules/@boxyhq/saml-jackson/dist/loadConnection.js
../../node_modules/.pnpm/@boxyhq+saml-jackson@1.26.7_@aws-sdk+client-sso-oidc@3.609.0/node_modules/@boxyhq/saml-jackson/dist/index.js
../api/src/app/saml/jackson.ts
../api/src/app/App.ts
../api/src/app/index.ts
../api/src/index.ts
../api/lib/server.ts
./src/features/auth/next-auth/server.ts
./src/app/[locale]/layout.tsx
Using engine: sql. Type: postgres

Steps to Reproduce

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

Technical details

niwsa commented 3 months ago

@Ziothh It should be safe to ignore as it's just a warning. Also you can try adding the specific dependecy to webpack ignore list here: https://github.com/boxyhq/jackson/blob/main/next.config.js#L22

Ziothh commented 3 months ago

@niwsa Thanks for the quick response. I copied that line of code into my project before but it didn't work. Probably because of the pnpm-specific module paths. I'll look into writing a matching regex expression.

One more question: Is there any way to make this log not appear when the creating controllers? Using engine: sql. Type: postgres

Screenshot 2024-07-05 at 14 16 41
niwsa commented 2 months ago

Is there any way to make this log not appear when the creating controllers?

At the moment we don't have a way to disable the info log.

Ziothh commented 2 months ago

Would you guys be willing to add way to disable it in the config?

It took me a while to figure out where this log was coming from and it's bloating our logs with information we already know.

niwsa commented 2 months ago

@Ziothh Sure we can add a flag to control the logging. We will be making this change in one of the future releases soon.

Ziothh commented 2 months ago

Thanks a lot!