Currently, I am trying to set up the @microsoft/signalr
npm package with webpack by importing the module using
import * as signalR from '@microsoft/signalr'
. However, I encountered an error message indicating that webpack is unable to resolve the internal paths of the module, as all 'missing' modules are part of signalr. When running webpack, the following log is displayed:
Log
assets by status 271 KiB [cached] 2 assets
orphan modules 589 KiB [orphan] 558 modules
runtime modules 937 bytes 4 modules
cacheable modules 598 KiB
modules by path ./src/ 589 KiB
./src/ts/index.ts + 558 modules 589 KiB [built] [code generated]
./src/scss/style.scss 376 bytes [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/scss/style.scss 301 bytes [built] [code generated]
modules by path ./node_modules/ 8.23 KiB
./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js 6.67 KiB [built] [code generated]
./node_modules/css-loader/dist/runtime/api.js 1.57 KiB [built] [code generated]
... (more compiler errors and warnings omitted for brevity)
Steps Taken So Far:
- Deleted
node_modules
and re-installed dependencies usingnpm i
- Attempted to directly import sub-modules like:
import { HubConnectionBuilder } from '@microsoft/signalr/dist/esm';
At this point, I have exhausted my search queries and am unsure how to proceed further. Here are some essential configurations for this project:
webpack.config.js
...
tsconfig.json
...
package.json Dependency Excerpt
...