You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone this minimal CRA project, to which the only change is the addition of blueprintjs/core and datetime2. https://github.com/cnrudd/blueprintjstester
Steps to reproduce
Clone this repo:
https://github.com/cnrudd/blueprintjstester
which is just Create React App with
When project runs with NPM npm start, project compilation errors out with:
Failed to compile.
Error: Can't resolve '~@blueprintjs/datetime/lib/css/blueprint-datetime.css' in '/Users/cnrudd/workspace/xh/bptester/src'
ERROR in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Expected behavior
Expecting no compilation error.
Possible solution
If I install the project with yarn, it works, no error.
But, if I want to run/manage the project with npm, I need to also add "@blueprintjs/datetime": "^5.3.5"
as a dependency in my package.json. Then, I can install using npm with: npm install --legacy-peer-deps
Then it compiles.
It looks like you may already be aware of this, because you have set up your example in codesandbox:
to import both datetime and datetime2, but, I'm not sure. The example is a little dated,
and your docs don't mention that @blueprintjs/datetime & @blueprintjs/datetime2 both need to be imported at the top level if using npm install. Nor do they mention the need for the --legacy-peer-deps option.
The problem appears to come from a difference in the way yarn (classic) and npm (latest) hoist packages.
NPM with no @blueprintjs/datetime top level dependency
~@blueprintjs/datetime/lib/css/blueprint-datetime.css is not found because it is nested within datetime2
Yarn classic with no "@blueprintjs/datetime" top level dependency or npm with a @blueprintjs/datetime top level dependency AND npm install --legacy-peer-deps:
I can think of 3 ways to resolve this issue:
The documentation on this page can be improved to mention that, if using npm, @blueprintjs/datetime needs to be added as a dependency, and that you need to install with --legacy-peer-deps?
Maybe the issue can be corrected via a code change to @blueprintjs/datetime2?
Do nothing in the near term because the issue will go away when @blueprintjs/datetime2 stops depending on @blueprintjs/datetime?
Any insights on which way you plan to go would be helpful.
Thank you!
The text was updated successfully, but these errors were encountered:
Environment
Package version(s):
"@blueprintjs/core": "5.10.3",
"@blueprintjs/datetime2": "2.3.5"
Operating System:
Windows and Mac
Browser name and version: not relevant
-Node Version: 20.14.0, LTS
Code Sandbox
Clone this minimal CRA project, to which the only change is the addition of
blueprintjs/core
anddatetime2
.https://github.com/cnrudd/blueprintjstester
Steps to reproduce
Clone this repo:
https://github.com/cnrudd/blueprintjstester
which is just Create React App with
added, and these imports added to
App.css
:Run these commands:
npm install
npm start
Actual behavior
When project runs with NPM
npm start
, project compilation errors out with:Expected behavior
Expecting no compilation error.
Possible solution
If I install the project with
yarn
, it works, no error.But, if I want to run/manage the project with
npm
, I need to also add"@blueprintjs/datetime": "^5.3.5"
as a dependency in my
package.json
. Then, I can install usingnpm
with:npm install --legacy-peer-deps
Then it compiles.
It looks like you may already be aware of this, because you have set up your example in codesandbox:
https://codesandbox.io/p/devbox/blueprint-v5-x-sandbox-react-16-wy0ojy?file=%2Fpackage.json
to import both
datetime
anddatetime2
, but, I'm not sure. The example is a little dated,and your docs don't mention that @blueprintjs/datetime & @blueprintjs/datetime2 both need to be imported at the top level if using
npm install
. Nor do they mention the need for the--legacy-peer-deps
option.The problem appears to come from a difference in the way yarn (classic) and npm (latest) hoist packages.
NPM with no
@blueprintjs/datetime
top level dependency~@blueprintjs/datetime/lib/css/blueprint-datetime.css is not found because it is nested within datetime2
![image](./?url=aHR0cHM6Ly9wcml2YXRlLXVzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8yNTczOTI4LzMzOTYyNDA0Mi1jZGM1Y2EwZC0wYmJlLTQyZmYtOGRmOS1iYWVlY2MyZTdkNDAucG5nP2p3dD1leUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpuYVhSb2RXSXVZMjl0SWl3aVlYVmtJam9pY21GM0xtZHBkR2gxWW5WelpYSmpiMjUwWlc1MExtTnZiU0lzSW10bGVTSTZJbXRsZVRVaUxDSmxlSEFpT2pFM01qUXdNekk1TnpFc0ltNWlaaUk2TVRjeU5EQXpNalkzTVN3aWNHRjBhQ0k2SWk4eU5UY3pPVEk0THpNek9UWXlOREEwTWkxalpHTTFZMkV3WkMwd1ltSmxMVFF5Wm1ZdE9HUm1PUzFpWVdWbFkyTXlaVGRrTkRBdWNHNW5QMWd0UVcxNkxVRnNaMjl5YVhSb2JUMUJWMU0wTFVoTlFVTXRVMGhCTWpVMkpsZ3RRVzE2TFVOeVpXUmxiblJwWVd3OVFVdEpRVlpEVDBSWlRGTkJOVE5RVVVzMFdrRWxNa1l5TURJME1EZ3hPU1V5Um5WekxXVmhjM1F0TVNVeVJuTXpKVEpHWVhkek5GOXlaWEYxWlhOMEpsZ3RRVzE2TFVSaGRHVTlNakF5TkRBNE1UbFVNREUxTnpVeFdpWllMVUZ0ZWkxRmVIQnBjbVZ6UFRNd01DWllMVUZ0ZWkxVGFXZHVZWFIxY21VOVpXVXdaV1kxWVRCak9EYzVaREkwWlRneVlqRTVZVGMxT1RBd1pUQmhOemxsTTJKak5Ua3pOakUzWVRobU9UY3haRFF5WkRFME56aG1OR0kxTnpjd01pWllMVUZ0ZWkxVGFXZHVaV1JJWldGa1pYSnpQV2h2YzNRbVlXTjBiM0pmYVdROU1DWnJaWGxmYVdROU1DWnlaWEJ2WDJsa1BUQWlmUS5FRHpBcHBERkRMTVhhNnZhWW5RcnJITDdJeUpYd3RpWHdGbldPOHlZcmI4&__proxy_form=0)
Yarn classic with no "@blueprintjs/datetime" top level dependency or
npm
with a@blueprintjs/datetime
top level dependency ANDnpm install --legacy-peer-deps
:I can think of 3 ways to resolve this issue:
@blueprintjs/datetime
needs to be added as a dependency, and that you need to install with--legacy-peer-deps
?@blueprintjs/datetime2
?@blueprintjs/datetime2
stops depending on@blueprintjs/datetime
?Any insights on which way you plan to go would be helpful.
Thank you!
The text was updated successfully, but these errors were encountered: