Open andylei18 opened 7 years ago
I am having the same error, hoping to get some answer
If you're not actually relying on the brfs/fs module I think you're safe to adjust the postLoader section specified at https://github.com/Flipboard/react-canvas#using-with-webpack to something like this:
module: {
postLoaders: [
{
include: __dirname + '/node_modules/linebreak',
loader: "transform?brfs"
}
]
}
This used to work for an older webpack 1.13 project... for which the brfs global npm install also was no longer needed.
^ When using this with webpack 2, if it complains that you're using "import" and "export" then it's acorn and this hasn't been merged yet: https://github.com/substack/static-module/pull/32. In which case, check workaround inside.
Module not found: Error: Can't resolve 'fs' in node_modules/linebreak/src' @ .//linebreak/src/linebreaker.js 7:7-20 @ .//react-canvas/lib/measureText.js @ ./~/react-canvas/lib/ReactCanvas.js