getting error Module not found: 'dgram' in postgres heroku app

1.2k views Asked by At

I'm trying to incorporate the postgres add-on in a heroku app that is also using react. When I try to run the app locally I get the following error:

> heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
9:21:18 PM web.1 |  > [email protected] start /Users/oliverpike/dev/heroku/ofp-react
9:21:18 PM web.1 |  > react-scripts start
9:21:19 PM web.1 |  Starting the development server...
9:21:25 PM web.1 |  Failed to compile.
9:21:25 PM web.1 |  Error in ./~/dns/~/native-dns/lib/server.js
9:21:25 PM web.1 |  Module not found: 'dgram' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/dns/node_modules/native-dns/lib

Apparently dgram is built into node according to this SO thread: Does node.js have built-in support for UDP(datagams)?

Here's the output of npm i dgram:

> npm i dgram
[email protected] node_modules/dgram
1

There are 1 answers

0
alvaropaco On

Apparently you trying to use the Sequelize and the pg Node modules in a client application, but this modules just run in a Node envirment and should not be used in client applications.