Skip to content
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

Twillio doesn't work with remix js #987

Open
vawogbemi opened this issue Dec 18, 2023 · 0 comments
Open

Twillio doesn't work with remix js #987

vawogbemi opened this issue Dec 18, 2023 · 0 comments

Comments

@vawogbemi
Copy link

vawogbemi commented Dec 18, 2023

twilio just doesn't work with remix and i've been trying lots of things

Reproduction

import twilio from "twilio";

const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

client.messages
.create({
body: 'This is the ship that made the Kessel Run in fourteen parsecs?',
from: process.env.TWILIO_NUMBER,
to: '+16476675845'
})
.then((message: any) => console.log(message.sid));

System Info

System:
OS: macOS 13.5
CPU: (4) x64 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz
Memory: 866.66 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
npm: 10.0.0 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 8.8.0 - ~/Library/pnpm/pnpm
npmPackages:
@remix-run/css-bundle: ^2.0.1 => 2.0.1
@remix-run/dev: ^2.0.1 => 2.0.1
@remix-run/eslint-config: ^2.0.1 => 2.0.1
@remix-run/node: ^2.0.1 => 2.0.1
@remix-run/react: ^2.0.1 => 2.0.1
@remix-run/serve: ^2.0.1 => 2.0.1

Used Package Manager

pnpm

Expected Behavior

twilio api working

Actual Behavior

when i first used require("twilio") i got a dynamic require error

i switched to import twilio and i got polyfill errors

I fixed the errors and now the remix just doesn't load the page that uses twilio. If I click a link to the messaging page, it just refreshes current page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant