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

🐛 BUG: Error when building Just the Basics starter : Cannot read properties of undefined (reading 'icon') #3473

Closed
1 task done
florian-s-code opened this issue May 30, 2022 · 5 comments · Fixed by #3496
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@florian-s-code
Copy link
Contributor

florian-s-code commented May 30, 2022

What version of astro are you using?

v1.0.0-beta.36

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

The build of "Just the basics" starter fails with the error : Cannot read properties of undefined (reading 'icon')
We have got 2 reports through Discord and I have been able to reproduce it.

Dev mode works, only the build fails.

Reproduction steps:

  1. Run npm init astro
  2. Choose "Just the basics" and default options (no integrations)
  3. Run npm run build
❯ npm run build --verbose
[...]

> @example/basics@0.0.1 build
> astro build

11:15:20 [build] Collecting build information...ed in 27ms
11:15:21 [build] Completed in 516ms.load Completed in 27ms
11:15:21 [build] Building entrypoints for prerendering...
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.
11:15:21 [build] Completed in 452ms.load Completed in 27ms

 generating static routes 
▶ src/pages/index.astro
 error   Cannot read properties of undefined (reading 'icon')
    at file:///tmp/tmp.SrDkX4sUEP/test/dist/entry.mjs?time=1653902121795:84:21
    at ft (file:///tmp/tmp.SrDkX4sUEP/test/dist/entry.mjs?time=1653902121795:66:398)
    at w (file:///tmp/tmp.SrDkX4sUEP/test/dist/entry.mjs?time=1653902121795:39:4033)
npm timing command:run Completed in 2513ms
npm verb exit 1
npm timing npm Completed in 2646ms
npm verb code 1

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added this to Needs Triage in 🐛 Bug Tracker May 30, 2022
florian-s-code added a commit to florian-s-code/astro that referenced this issue May 30, 2022
Simple fix for withastro#3473 as the slot was never used in this example.
@florian-s-code
Copy link
Contributor Author

florian-s-code commented May 30, 2022

I have proposed a quick fix for this specific theme so that people starting with create-astro and the "Just the basics" starter are not let down by a bug on their first build.

It seems to be a structural bug with named slots, that break the build if no content is passed. A better fix is needed.

sarah11918 added a commit that referenced this issue May 30, 2022
Simple fix for #3473 as the slot was never used in this example.

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@sarah11918
Copy link
Member

I merged #3475 to implement a quick fix, so that the starter builds, but leaving this issue OPEN for @bholmesdev or anyone who wants to implement a different solution.

@bholmesdev
Copy link
Contributor

Looks good, thanks for catching this! Happy to close 👍

🐛 Bug Tracker automation moved this from Needs Triage to Done May 30, 2022
@natemoo-re natemoo-re reopened this May 31, 2022
🐛 Bug Tracker automation moved this from Done to Needs Triage May 31, 2022
@natemoo-re
Copy link
Member

Reopening this since the underlying bug is still a problem. I'm looking into it.

@natemoo-re natemoo-re self-assigned this May 31, 2022
@natemoo-re natemoo-re moved this from Needs Triage to Accepted in 🐛 Bug Tracker May 31, 2022
@natemoo-re natemoo-re added - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) s1-small labels May 31, 2022
@natemoo-re natemoo-re assigned matthewp and unassigned natemoo-re May 31, 2022
@matthewp
Copy link
Contributor

matthewp commented Jun 1, 2022

We have a default parameter we use internally for children, something like function render(.., children = {}) and that is being tree-shaken away. I'm pretty sure it's this Rollup change causing it: rollup/rollup#4498

It was reverted today: rollup/rollup#4520

So going to try again and see if the problem goes away.

🐛 Bug Tracker automation moved this from Accepted to Done Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants