solidjs / solidjs/solid

inconsistent owner in Component function (production vs development build) result in out of order onCleanup

Open
#1,561 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug PRs Welcome
Dominant language
TypeScript
Stars
36.1k
Forks
1.1k
Avg merge
9h 18m
Merged PRs (30d)
195

Description

Describe the bug

A component function owner is different between a dev and prod build

function MyComponent(){
     getOwner()   // <--  this is different between prod/dev builds.
                  //      in prod the owner is of the parent, in dev it is a new owner scope.
     return <></>
}

this inconsistency causes unexpected behavior, for example when using solid's onCleanup primitive

dev build playground
image

production build playground

image

note: production build is working as designed, it is dev that alters the expectations

Your Example Website or App

.

Steps to Reproduce the Bug or Issue

see playground links for the difference between dev and prod

Expected behavior

it is expected that dev and prod will work similarly, in regard to owner scopes.

Screenshots or Videos

No response

Platform

.

Additional context

No response

related discussion of the issue
https://discord.com/channels/722131463138705510/1075879661134942238

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with getOwner and onCleanup behavior in the linked development and production playgrounds, then compare how the two builds establish component owner scopes. Done means development and production behave consistently for owner scopes and cleanup ordering, matching the stated production behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.