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

Can't import the named export 'URL' from non EcmaScript module (only default export is available) #868

Closed
Akash667 opened this issue Sep 21, 2021 · 13 comments · Fixed by #870
Assignees
Labels
bug Something isn't working priority: critical

Comments

@Akash667
Copy link

Akash667 commented Sep 21, 2021

Bug report

Expected behavior
Should have installed all the dependencies

Observed behavior
Frontity fails to install upon running npx frontitty dev

Steps involved to reproduce the problem

  1. Use npx frontity create my-app
  2. cd my-app
  3. npx frontity dev

ERROR in ./node_modules/node-fetch/lib/index.mjs 1157:18-21 Can't import the named export 'URL' from non EcmaScript module (only default export is available) @ ./node_modules/frontity/dist/src/index.js @ ./node_modules/@frontity/tiny-router/src/actions.ts @ ./node_modules/@frontity/tiny-router/src/index.ts @ ./build/bundling/entry-points/server.ts

Info about your system

System:

  • OS: Windows 10 10.0.19043
  • CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
  • Memory: 5.47 GB / 15.85 GB

Binaries:

  • Node: 14.17.6 - C:\Program Files\nodejs\node.EXE
  • npm: 7.5.2 - C:\Program Files\nodejs\npm.CMD

Browsers:

  • Chrome: Not Found
  • Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.52)
  • Internet Explorer: 11.0.19041.1202

npmPackages:

  • @frontity/core: ^1.14.3 => 1.14.3
  • @frontity/html2react: ^1.7.0 => 1.7.0
  • @frontity/mars-theme: ./packages/mars-theme => 1.6.1
  • @frontity/tiny-router: ^1.4.4 => 1.4.4
  • @frontity/wp-source: ^1.11.5 => 1.11.5
  • frontity: ^1.17.0 => 1.17.0

npmGlobalPackages:

  • frontity: Not Found
  • npx: Not Found

Possible solution

@TreliaGT
Copy link

Having the same issue sadly

@therealjgrant
Copy link
Contributor

Same here, tried Node 14.17.6 & 16.9.1

@TreliaGT
Copy link

has something updated lately, I just started learning this today

@sainer
Copy link

sainer commented Sep 21, 2021

I have the same problem. Node 14.16.0. I've updated both my project and my packages to the latest Frontity versions and the problem still occurs.

@luisherranz
Copy link
Member

node-fetch recently changed to ESM only, maybe it is related to that. I'll take a look.

@robrecord
Copy link

robrecord commented Sep 21, 2021

@luisherranz I did explore the change to ESM only too, but it doesn't lead anywhere since we're not using version 3 in frontity.

I think this caused because node-fetch has a bug in version 2.6.3 and 2.6.4 where they add an import that doesn't seem to work.

In that case maybe frontity needs to pin the version to 2.6.2

@lluisd
Copy link

lluisd commented Sep 21, 2021

same issue here for the first time installing it

@nicholasio
Copy link
Collaborator

if you explicitly set the version to 2.6.2 by adding node-fetch to package.json does it solve the issue?

@luisherranz
Copy link
Member

if you explicitly set the version to 2.6.2 by adding node-fetch to package.json does it solve the issue?

It does indeed.

Good catch @robrecord 🙂

@lluisd
Copy link

lluisd commented Sep 22, 2021

why is closed? is still happening at me... I still have 2.6.1 version in the node_modules frontity package

@luisherranz
Copy link
Member

luisherranz commented Sep 22, 2021

Issues are closed once a fix is merged to the base branch. After that, you need to wait for the next release, which @SantosGuillamot started 1 hour ago: #871

@SantosGuillamot
Copy link
Member

After that, you need to wait for the next release, which @SantosGuillamot started 1 hour ago: #871

This is already done 🙂 The issue should be solved now.

@luisherranz
Copy link
Member

Thanks Mario!

Please update your Frontity packages using this guide: https://docs.frontity.org/guides/keep-frontity-updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants