Skip to content

createResource swallows error #1744

@mathieuprog

Description

@mathieuprog

Describe the bug

Errors happening in the fetcher of the createResource seem to be swallowed:

window.addEventListener('unhandledrejection', (e) => console.error(e));
window.addEventListener('error', (e) => console.error(e));

function getCurrentUserResource() {
  const [currentUser] =
    createResource<any>(
      async () => {
        console.log('hello!') // logs
        throw 'error'; // swallowed
      }
    );

  return currentUser;
}

getCurrentUserResource();

Your Example Website or App

Steps to Reproduce the Bug or Issue

Expected behavior

Expected to see the error in the console

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome 113
  • Solid: 1.7.5

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