Node env Error: Can't resolve 'fs'
See original GitHub issueThis is my full code :
import juice from 'juice'
import htmlDocx from 'html-docx-js'
import { saveAs } from 'file-saver'
export default {
methods: {
handleExport () {
var content = htmlDocx.asBlob('hello')
saveAs(content, 'test.docx')
}
}
}
Run webpack
compiler,Cmd show a error :
Module not found: Error: Can't resolve 'fs' in 'F:\gittest\js-office-demo\node_modules\html-docx-js\build
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Error: Can't resolve 'fs' in node_modules\dotenv\lib' - Stack ...
env file, I imported dotenv and I exported the module where there is all my environment and these variables as if below. export...
Read more >Module not found: Error: Can't resolve 'fs' · Issue #581 - GitHub
Module not found: Error: Can't resolve 'fs' #581 ... I have tried everything even experienced coders don't know. process.env is not working!
Read more >module not found error can't resolve 'fs' in dotenv react
The reason you are running into this error is because dotenv is meant to be used in Node.js, not in the browser. If...
Read more >can't resolve 'fs' in dotenv - Autoinfo
node = { fs: 'empty' } to my next.config.js file. Can you verify that you replaced all 'react-native-dotenv' imports with the '@env' import?...
Read more >Node.js – Can't resolve 'fs' in nextjs with custom express server
I found that to resolve this issue, I should add config.node = { fs: 'empty' } to my next.config.js file. The problem is...
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 FreeTop 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
Top GitHub Comments
@abhisheknalin try consume bundled version from
/dist
folder. E.g.:Thanks a lot for your time.
import htmlDocx from 'html-docx-js/dist/html-docx';
this import works