[X] I agree to follow the Code of Conduct that this project adheres to.
[X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
[X] This is not a general Twilio feature request or bug report. It is a feature request for the twilio-node JavaScript package.
Problem Description
I added twilio on my package and then i did "npm start" . And lot's of error appear :
First i had this error :
Error: src/services/twilio.service.ts:3:24 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
import { Twilio } from 'twilio';
So i added in tscondig.js "allowSyntheticDefaultImports".
And then i did npm start again and i had this error :
Error: Module not found: Error: Can't resolve 'assert' in 'C:\Users\mgasnier\source\repos\Nationex - TPSL Mobile\TPSLMobileCapacitor\node_modules\twilio\node_modules\https-proxy-agent\dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "assert": false }
Preflight Checklist
Problem Description
I added twilio on my package and then i did "npm start" . And lot's of error appear :
First i had this error :
Error: src/services/twilio.service.ts:3:24 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export. import { Twilio } from 'twilio';
So i added in tscondig.js "allowSyntheticDefaultImports".
And then i did npm start again and i had this error :
Error: Module not found: Error: Can't resolve 'assert' in 'C:\Users\mgasnier\source\repos\Nationex - TPSL Mobile\TPSLMobileCapacitor\node_modules\twilio\node_modules\https-proxy-agent\dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
I have this for a hundred of modules.
This is my package.json and tsconfig.json:
Proposed Solution
Idk
Alternatives Considered
/
Additional Information
No response