Skip to content

createAsync problem (Rollup build) #534

@benbriedis

Description

@benbriedis

Describe the bug

createAsync doesn't call the function it wraps and doesn't return or throw an error.

It works for Vite, but not my Rollup build. Note I'm not using Solid Start.

It seems to me that proceeding the createAsync call with a call to createResource can may click it into working, but I'm not positive about this.

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-e4mb5hte?file=src%2Fclient.entry.js,src%2Fapp.js,src%2Fserver.entry.js

Steps to Reproduce the Bug or Issue

The problem code looks like this:

const Home = () => {
  const testAsync = () => new Promise((resolve) => {
    resolve('success');
  });
  
  const [runCreateResource] = createResource(testAsync);
  const runCreateAsync = createAsync(testAsync);

  return (
    <div>
      createResource: {runCreateResource()} <br/>
      createAsync: {runCreateAsync()}
    </div>
  );

Expected behavior

You should see the createResource return successfully, and the createAsync call fail.

Screenshots or Videos

No response

Platform

  • OS: Linux

  • Browser: Chrome and FF (at least)

    "devDependencies": {
    "@rollup/plugin-babel": "^6.0.4",
    "@rollup/plugin-node-resolve": "^16.0.0",
    "babel-preset-solid": "^1.9.3",
    "express": "^4.21.2",
    "rollup": "^4.29.1",
    "solid-js": "^1.9.3"
    },
    "dependencies": {
    "@solidjs/router": "^0.15.2"
    }

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions