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
Describe the bug
Running npm run gen throws the following error on Windows:
To Reproduce
Be on Windows 10
Run npm install
Run npm run gen from the root of the project or from examples dir
See the same error as the screenshot above
Misc
Node version: 18.20.3
Package manager: pnpm
Browser: Chrome
I'm a sponsor and would appreciate if you could look into this sooner than later 💖
I was hitting my head for an hour trying to figure this one out. When I comment out fs.writeFileSync the error is gone, and this seems to be originating from the way we're getting the path/dir :
const dir = path.parse(import.meta.url.replace("file://", "")).dir;
This issue is in every instance of the above code, in gen.ts, genDocs.ts, and util.ts
I was only able to generate the example code in #954 using my MacOS. So this issue is exclusively on Windows.
@jkcs That silenced the error but it doesn't seem to be actually generating the examples.gen.tsx due to getExampleProjects not finding any example files due to it not knowing the exact path
That only silenced the errors. But unfortunately it can't read any example directories which makes it output an empty example object in examples.gen.tsx
Ah yeah, I was also running into this when I was working on Windows way back. Basically, node:path handles Windows and MacOS paths pretty differently and it's just kind of a pain. Unfortunately the solution that was most convenient for me was removing all path calls and replacing them with hardcoded strings:(
Activity
jkcs commentedon Jul 19, 2024
need change
zaaakher commentedon Jul 19, 2024
@jkcs That silenced the error but it doesn't seem to be actually generating the examples.gen.tsx due to
getExampleProjectsnot finding any example files due to it not knowing the exact pathjkcs commentedon Jul 22, 2024
try this:https://github.com/TypeCellOS/BlockNote/pull/818/files#diff-93421da21c480705d1154839957c6737a254abe9cc85a0e91f792ce42627e17e
zaaakher commentedon Jul 22, 2024
That only silenced the errors. But unfortunately it can't read any example directories which makes it output an empty example object in
examples.gen.tsxmatthewlipski commentedon Jul 22, 2024
Ah yeah, I was also running into this when I was working on Windows way back. Basically,
node:pathhandles Windows and MacOS paths pretty differently and it's just kind of a pain. Unfortunately the solution that was most convenient for me was removing allpathcalls and replacing them with hardcoded strings:(YousefED commentedon Jul 29, 2024
/bounty 10
algora-pbc commentedon Jul 29, 2024
💎 $10 bounty • BlockNote
Steps to solve:
/attempt #955with your implementation plan/claim #955in the PR body to claim the bountyThank you for contributing to TypeCellOS/BlockNote!
Add a bounty • Share on socials
rogueloop commentedon Jul 29, 2024
/attempt #955
Python & more
algora-pbc commentedon Jul 30, 2024
💡 @jkcs submitted a pull request that claims the bounty. You can visit your bounty board to reward.
algora-pbc commentedon Aug 6, 2024
@jkcs: You've been awarded a $10 bounty by BlockNote! We'll notify you once it is processed.
algora-pbc commentedon Aug 31, 2024
🎉🎈 @jkcs has been awarded $10! 🎈🎊