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

Existencia de "require" - ES Module -> mudar para "import()" - Common JS #243

Open
robertoshimizu opened this issue May 4, 2022 · 1 comment

Comments

@robertoshimizu
Copy link

Após atualizar a versão do Nuxt3, o código quebrou no build aparecendo este erro:

Instead change the require of index.js in ~/nuxt3-app/.output/server/node_modules/cep-promise/dist/cep-promise.min.js to a dynamic import() which is available in all CommonJS modules.

Após verificar o arquivo "cep-promise.js", notei que havia mesmo um "factory(require('node-fetch'))". EU alterei na minha instância para "factory(import('node-fetch'))" e o build completrou sem problemas.

Sugiro que considere verificar se tal issue faz sentido e talvez atualizar o código, pois no build do heroku, ele vai continuar a chamar a versão atual do cep-promise e vai acarretar este erro novamente.
Obrigado
Roberto

@victorfernandesraton
Copy link

victorfernandesraton commented Jun 5, 2022

A sugesão que eu daria seria usar o axios como client universal por padrão ou usar a fetch api se disponivél

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

2 participants