felixge / felixge/node-dateformat

dateformat not working with "require" ?

Aberta
#176 8 comentários 9 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
1.3k
Forks
155
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

using import I get this error
```SyntaxError: Cannot use import statement outside a module```
while using require this error
```
Error [ERR_REQUIRE_ESM]: require() of ES Module /var/www/html/wikisphere-nodejs/node_modules/dateformat/lib/dateformat.js from /var/www/html/wikisphere-nodejs/fetch.js not supported.
Instead change the require of dateformat.js in /var/www/html/wikisphere-nodejs/fetch.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/var/www/html/wikisphere-nodejs/fetch.js:30:18) {
code: 'ERR_REQUIRE_ESM'
```

any hint ?

(node v16.13.0
npm 8.1.0)

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.