question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation errors when using non-CRA build

See original GitHub issue

Version

botframework-webchat@4.7.1 via npm

Describe the bug

I’m having problems getting the npm version to work with our build setup. We’re using a default nx generated React app. When trying to run the build I’m seeing lots of Module not found errors.

Please see Build Errors below for the full output.

Steps to reproduce

  1. Clone the minimal test case repository: git clone git@github.com:KarlPurk/nx-repro-bot-framework-web-chat.git
  2. Run the build: npx @nrwl/nx build bot

Expected behavior

Project should build without errors.

Additional context

I reported this on the nx repository. You can see the issue here.

I’ve been able to get this working with CRA without any problems.

Build Errors

➜  bot-framework-web-chat-npm git:(master) ✗ npx @nrwl/nx build bot
Starting type checking service...
Using 10 workers with 2048MB memory limit
Hash: 0d9c5f46124ebecb6461
Built at: 03/04/2020 1:13:44 PM
Entrypoint main = runtime.js runtime.js.map vendor.js vendor.js.map main.js main.js.map
Entrypoint polyfills = runtime.js runtime.js.map polyfills.js polyfills.js.map
Entrypoint styles = runtime.js runtime.js.map styles.js styles.js.map
chunk {main} main.js, main.js.map (main) 47.9 KiB ={runtime}= ={vendor}= [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 239 KiB ={runtime}= [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 0 bytes ={main}= ={polyfills}= ={styles}= ={vendor}= [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 7.75 KiB ={runtime}= [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 6.66 MiB ={main}= ={runtime}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/node_modules/jwa/index.js
Module not found: Error: Can't resolve 'crypto' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/node_modules/jwa'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/replace-ext/index.js
Module not found: Error: Can't resolve 'path' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/replace-ext'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/vfile/core.js
Module not found: Error: Can't resolve 'path' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/vfile'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/BehaviorSubject' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/dom/ajax' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/empty' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/from' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/interval' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/of' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/observable/throw' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/catch' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/combineLatest' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/count' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/delay' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/do' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/filter' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/map' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/mergeMap' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/retryWhen' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/share' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib/directLine.js
Module not found: Error: Can't resolve 'rxjs/add/operator/take' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/botframework-directlinejs/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib/sign-stream.js
Module not found: Error: Can't resolve 'stream' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib/verify-stream.js
Module not found: Error: Can't resolve 'stream' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib'

ERROR in /Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib/data-stream.js
Module not found: Error: Can't resolve 'stream' in '/Users/karl/SourceCode/bot-framework-web-chat-npm/node_modules/jws/lib'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
KarlPurkcommented, Jun 24, 2020

@xtianus79 I managed to fix this by updating my webpack config to polyfill crypto:

node: {
    crypto: true
}

I still needed to install rxjs-compat but didn’t need the node-libs-browser polyfills.

0reactions
xtianus79commented, Jun 21, 2020

@compulim this is still an issue as the directline package is broken. This shouldn’t be happening. I don’t even know what rxjs-compat is. If directly line is only compaititble with a certain version of rxjs it should bring in the packages it needs for that. When people are using rxjs 6 the expectation this npm package should work.

Can you please reopen the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

85 - Stack Overflow
How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)" · 1.
Read more >
Compiler not catching compile error - MSDN - Microsoft
Is there a simple way that I can use the external aspx compiler as a post-build step and have it dump the results...
Read more >
what accuracy and errors mean for consumers hearing - GovInfo
solve obvious errors in their credit reports, with little success. One of those consumers is here with us today to share her story....
Read more >
Search - appsloveworld
[Solved]-How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)"-Reactjs.
Read more >
FRB: Finance and Economics Discussion Series
Community groups can and often do use the HMDA data and other resources to build a case against a bank. In response, banks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found