process.cwd is not a function when running example
See original GitHub issueHello,
Im trying to run the example, but Im getting the error from vfile lib. The example looks pretty straight forward so I didn’t expect any issues. I wonder what I may possibly do incorrect because running process.cwd() (core.js:47) in browser sounds a bit unnatural.
TypeError: Object(...).cwd is not a function
at new VFile (core.js:47)
at VFile (core.js:41)
at Function.parse (index.js:269)
at ReactMarkdown (react-markdown.js:31)
at ProxyFacade (react-hot-loader.development.js:617)
at mountIndeterminateComponent (react-dom.development.js:8574)
at beginWork (react-dom.development.js:8978)
at performUnitOfWork (react-dom.development.js:11814)
at workLoop (react-dom.development.js:11843)
at renderRoot (react-dom.development.js:11874)
appreciate all hints and help, cheers
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Express JS in Altassian Forge causing "process.cwd is not a ...
1 Answer 1 · If process.cwd() is only used in test cases or example code, you can delete it or make sure it's...
Read more >Node.js process.cwd() Method - GeeksforGeeks
Return Value: This method returns a string specifying the current working directory of the node.js process. Below examples illustrate the ...
Read more >Process | Node.js v19.3.0 Documentation
The process.abort() method causes the Node.js process to exit immediately and generate a core file. This feature is not available in Worker threads ......
Read more >process.Process.cwd JavaScript and Node.js code examples
async function generate(args, options) { const pageres = new Pageres({ incrementalName: !options.overwrite }).dest(process.cwd()); for (const argument of ...
Read more >Process - node - Read the Docs
Example of listening for exit : process.on('exit', function(code) { // do *NOT* do this setTimeout(function() { console.log('This will not run'); } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@anicholson thank you for the input, I solved it too. In my case I was using
webpack.DefinePluginto pass env to a node.vfile’sprocesswas replaced by hash with envs that doesn’t containcwdfunction - thats why I got errorObject(...).cwd is not a function. Initially I added noopcwd, but broke some Uglify functionalities. So my final solution is to look for whole'process.env'.Or, you know, you can update
react-markdown?