Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module ./node-fs.js error in browser context #461

Open
romkavt opened this issue Jan 14, 2025 · 0 comments
Open

Cannot find module ./node-fs.js error in browser context #461

romkavt opened this issue Jan 14, 2025 · 0 comments

Comments

@romkavt
Copy link

romkavt commented Jan 14, 2025

After asciidoctor-kroki upgrade from version 0.17 to 0.18.1, I have experiencing
Cannot find module ./node-fs.js error in browser context (asciidoctor-kroki running in browser).

I am not JS developer, but made some debugging in browser dev tools and found source of error.
Here is a breaking change between versions(see line 152 of preprocess.js):
v0.17.0...v0.18.1#diff-cce3483983413018bc60906dc038fe0c28ab443f7910d69110d055a81fa70f18R152

The error occurs on
const parse = typeof vfs !== 'undefined' && typeof vfs.parse === 'function' ? vfs.parse : require('./node-fs.js').parse
becase typeof vfs.parse is "object".

Than, I've changed line back to 0.17.0 version
text = preprocessPlantUmlIncludes(text, path.dirname(result.filePath), includeOnce, includeStack, includePaths, vfs, logger)
and browser context works fine now.

I am not JS developer, I unsure I'll able to make correct patch. Hope someone fix this.

Tested in Yandex.Browser (Chromium engine) version 24.12.0.1845 on Mac OS 14.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant