fix(shared): Fix error on post-build script with existing subpath barel directories#1971
fix(shared): Fix error on post-build script with existing subpath barel directories#1971dimkl wants to merge 1 commit into
Conversation
|
2079ccc to
5af18e9
Compare
| '@clerk/shared': patch | ||
| --- | ||
|
|
||
| Fix issue with existing directories upon building already built `@clerk/shared` |
There was a problem hiding this comment.
This is an issue internal to us, I don't think we'd need to put this into the changelog
There was a problem hiding this comment.
This issue can be shown in any contributor trying to build the shared package. that's why i have added a changelog entry but i will remove it since you suggest it.
| fs.mkdirSync(new URL(`../packages/${pkgName}/${name}`, import.meta.url)); | ||
| const directoryURL = new URL(`../packages/${pkgName}/${name}`, import.meta.url); | ||
| if (!fs.existsSync(directoryURL)) { | ||
| fs.mkdirSync(); |
There was a problem hiding this comment.
You're missing the directoryURL inside mkdirSync.
For me the function exits early at line 32, did it not do that for you?
5af18e9 to
678a689
Compare
|
Closing in favor of #1974 |
|
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
When building a repository with already existing subpath barrel files in shared, the
post-buildof shared package failed because of trying to create existing subpath files directories.To resolve this we added a check to only create the directory if it does not exist.
PS: This issue is only visible in local development when the shared package is already built once (after the change that creates temporary directories subpath barrel directories).
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore