-
Notifications
You must be signed in to change notification settings - Fork 19
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
ts-invariant 'cant resolve imported dependency process/browser' -- conflict with webpack 5 typical polyfill #287
Comments
same issue |
found solution, adding fullySpecified to false /* config-overrides.js */
const webpack = require('webpack')
module.exports = function override(config) {
const fallback = config.resolve.fallback || {}
Object.assign(fallback, {
util: require.resolve('util/'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer'),
assert: require.resolve('assert'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify'),
url: require.resolve('url'),
})
config.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser',
}),
)
config.module.rules = [
...config.module.rules,
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
]
config.resolve.fallback = fallback
config.ignoreWarnings = [/Failed to parse source map/]
return config
} |
@luckyrobot Thanks. This appears to work but it seems like such a monkey patch for this library. |
@disarticulate What version of It seems like webpack is injecting an import for |
looks like @apollo-client @ 3.6.2 installs ts-variant @ 0.10.2 |
thanks bro |
I avoided the problem by replacing |
thanks bro |
this package appears to conflict with a seemingly standard polyfill in webpack5:
resulting in this error:
eg, https://stackoverflow.com/questions/65018431/webpack-5-uncaught-referenceerror-process-is-not-defined
Not sure how process is working in this instance, but a likely fix is just to rename the folder for import.
It compiles without the plugin/alias, but then throws in other packages because process is not available.
The text was updated successfully, but these errors were encountered: