jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
933 stars 50 forks source link

Failed to load error when using 0.3.13 #6

Closed tylergaw closed 2 years ago

tylergaw commented 2 years ago

Setup

Seeing a bug when attempting to start or build astro. This happens just from importing asto-seo

index.astro

---
import { SEO } from "astro-seo";
---

<html>...content here</html>
yarn build

Relevant part of error:

[17:23:38] [esinstall:astro-seo] Failed to load ../src/SEO.astro
  Identifier 'props' has already been declared (Note that you need plugins to import files that are not JavaScript)

If I roll back 0.3.11 this doesn't happen.

Full error message:

[17:23:38] [snowpack] + astro-seo@0.3.13
[17:23:38] [esinstall:astro-seo] Failed to load ../src/SEO.astro
  Identifier 'props' has already been declared (Note that you need plugins to import files that are not JavaScript)
(node:96561) UnhandledPromiseRejectionWarning: Error: Install failed.
    at Object.install (/Users/tyler/workspace/rokt/rokt.com/node_modules/esinstall/lib/index.js:374:19)
    at async Object.installPackages (/Users/tyler/workspace/rokt/rokt.com/node_modules/snowpack/lib/cjs/sources/local-install.js:24:25)
    at async /Users/tyler/workspace/rokt/rokt.com/node_modules/snowpack/lib/cjs/sources/local.js:537:39
    at async PackageSourceLocal.buildPackageImport (/Users/tyler/workspace/rokt/rokt.com/node_modules/snowpack/lib/cjs/sources/local.js:444:30)
    at async PackageSourceLocal.prepare (/Users/tyler/workspace/rokt/rokt.com/node_modules/snowpack/lib/cjs/sources/local.js:220:13)
    at async startServer (/Users/tyler/workspace/rokt/rokt.com/node_modules/snowpack/lib/cjs/commands/dev.js:240:9)
    at async createSnowpack (file:///Users/tyler/workspace/rokt/rokt.com/node_modules/astro/dist/runtime.js:283:14)
    at async createRuntime (file:///Users/tyler/workspace/rokt/rokt.com/node_modules/astro/dist/runtime.js:303:7)
    at async build (file:///Users/tyler/workspace/rokt/rokt.com/node_modules/astro/dist/build.js:40:24)
    at async buildAndExit (file:///Users/tyler/workspace/rokt/rokt.com/node_modules/astro/dist/cli.js:12:15)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:96561) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:96561) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
jonasmerlin commented 2 years ago

@tylergaw Interesting, thank you for reporting this! I will investigate later today and then get back to you with a solution (hopefully). Expect 0.3.14 later today!

jonasmerlin commented 2 years ago

@tylergaw Sadly, I can't reproduce this. Tried it on astro@latest (0.20.12) as well as 0.20.6, but in both cases, I don't get any errors when importing and using astro-seo. Can you maybe provide a reproduction? Or maybe just a bit more of the contents of your index.astro would already be enough, actually. Like are there any other components you import that I could test with?

natemoo-re commented 2 years ago

Seeing as this is an esinstall issue (an internal package of Snowpack), this will very likely be fixed with astro@0.21 and the next version of astro-seo (assuming https://github.com/jonasmerlin/astro-seo/pull/24 is merged)