You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an angular 17 project running with webkit 5, I cannot get rid of the following error in a node module path_scurry which is not directly used anywhere in the client code::
./node_modules/path-scurry/dist/mjs/index.js:10:0-65 - Error: Module not found: Error: Can't resolve 'fs/promises' in '/workspaces/my-app/node_modules/path-scurry/dist/mjs'
// Polyfills are not supported yet required in order to support older browsers.// If polyfills are required, webpack may require additions.constHtmlWebpackPlugin=require('html-webpack-plugin');constpath=require('path');const{ config }=require('process');constTerserPlugin=require('terser-webpack-plugin');module.exports={target: 'node',node: 'empty',mode: process.env.NODE_ENV||'production',entry: './src/main.tsx',output: {path: path.resolve(__dirname,'dist'),filename: 'index.js'},plugins: [newHtmlWebpackPlugin({title: "Architects' Game",favicon: './src/globe.png'})],devtool: 'inline-source-map',optimization: {minimizer: [newTerserPlugin({parallel: true,terserOptions: {ecma: 5}})]},module: {rules: [{test: /\.ts$/,exclude: /node_modules/,use: {loader: 'ts-loader'}},{test: /\.js$/,exclude: /node_modules/,use: {// without additional settings, this will reference .babelrcloader: 'babel-loader'}},{test: /\.tsx?$/,loader: 'ts-loader',options: {transpileOnly: true}},{test: /\.css$/,include: path.join(__dirname,'src'),use: ['style-loader',{loader: 'typings-for-css-modules-loader',options: {modules: true,namedExport: true}}]},{test: /\.scss$/,use: [{loader: 'style-loader'},// to inject the result into the DOM as a style block{loader: 'css-modules-typescript-loader'},// to generate a .d.ts module next to the .scss file (also requires a declaration.d.ts with "declare modules '*.scss';" in it to tell TypeScript that "import styles from './styles.scss';" means to load the module "./styles.scss.d.td"){loader: 'css-loader',options: {modules: true}},// to convert the resulting CSS to Javascript to be bundled (modules:true to rename CSS classes in output to cryptic identifiers, except if wrapped in a :global(...) pseudo class){loader: 'sass-loader'}// to convert SASS to CSS// NOTE: The first build after adding/removing/renaming CSS classes fails, since the newly generated .d.ts typescript module is picked up only later]}]},resolve: {extensions: ['.ts','.tsx','.js','.jsx','.scss'],fallback: {stream: require.resolve('stream-browserify'),url: require.resolve('url'),fs: false,assert: false}},devServer: {contentBase: './dist',host: 'localhost',compress: false,port: 3000,disableHostCheck: false,overlay: {warnings: true,errors: true},hot: true,// https: trueindex: 'index.html'},stats: {colors: true}};
Client Code
I have this client typescript prototype code, if it matters:
Overview
In an angular 17 project running with webkit 5, I cannot get rid of the following error in a node module
path_scurry
which is not directly used anywhere in the client code::Build Line
ng cache clean && ng build
What I Have Tried Already
Followed advise from #447, module-not-found-error-cant-resolve-fs-error-solved, and #1612, without success.
Important Artifacts
tsconfig.json
angular.json
webpack.config.js
Client Code
I have this client
typescript
prototype code, if it matters:package.json
Current Behavior
Error like so:
How To Reproduce
ng cache clean && ng build
Expected behavior
Expect no compilation error related around
fs/promises
, especially with node module not included directly in the client code, here path_scurry.Screenshots
Nothing in addition to error message already provided above
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationAdditional context
None
The text was updated successfully, but these errors were encountered: