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?]: template is not a function Bug happening in production only #1106

Closed
2 tasks done
wakaztahir opened this issue Nov 2, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@wakaztahir
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When using a Spinner component inside a DisplayResource component, Where DisplayResource displays a spinner if a resource hasn't loaded yet

The error occurs only in production mode

The errored line is at https://github.com/wakaztahir/solid-start-production-bug/blob/fb31b2de270f191081aab90ab86e16134f8f3f6c/src/solid/components/Utils.tsx#L56

Expected behavior 🤔

There should be no error in production mode

Steps to reproduce 🕹

Steps:

  1. Clone https://github.com/wakaztahir/solid-start-production-bug.git
  2. Run yarn install
  3. Run build:serve and go to localhost:8080/project/something

When running in dev mode the error doesn't happen at localhost:3000/project/something

Context 🔦

Just trying to use a Spinner component from my UI library along with solidjs and solid-start

That spinner component is in a DisplayResource which is a component that checks if the resource has loaded and then displays it

Also displays a spinner if the component hasn't loaded, However the error happens when there's a spinner in the DisplayResource and doesn't happen if there isn't, The error also only happens in production mode

Also there's a error overlay in production mode, I thought there wasn't supposed to be an error overlay in production mode, But whatever

Your environment 🌎

OS : Windows
Node : v20.7.0
@wakaztahir wakaztahir added the bug Something isn't working label Nov 2, 2023
@wakaztahir
Copy link
Author

Its important that you open the route where the error occurs, /project/something

@lxsmnsyc
Copy link
Member

It's most likely SolidStart loading your client build from @qinetik/anique. I'd recommend shipping with a solid mode build (which uses preserved JSX).

@wakaztahir
Copy link
Author

wakaztahir commented Dec 19, 2023

Yeah I've fixed this, actually I had to write configuration for another build which included babel preset with ssr true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants