Skip to content

Uncaught TypeError: L.Application is not a constructor #65

Description

@mr-akashdesai

Hi, I'm having some issues rendering my spline onto my project. It all looks fine on the CodeSanbox link provided but when using it within my own app, there seems to be an issue. I am using React w/ Typescript and webpack. Here is the component:

image

Whenever I try to render the component, a TypeError is thrown regarding L.Application is not a constructor:

image

I'm not really sure what the error means but it was addressing a ForwardRef component so it could potentially be something around the ForwardRefExocticComponent as shown below

image

Please let me know if you have any ideas. Thanks 🙂

Activity

  1. marcofugaro commented on Jul 25, 2022

    @marcofugaro
    Contributor

    I am using React w/ Typescript and webpack.

    I think the issue is in your setup. Could you share an example repo of the problem happening?

  2. mr-akashdesai commented on Jul 25, 2022

    @mr-akashdesai
    Author

    Yeah sure, I've just made a new repo, partially cloning my app but using all the same dependencies and config.
    If you want to run it:
    npm install
    then
    npm start

    https://github.com/mr-akashdesai/spline-mockup

  3. marcofugaro commented on Jul 25, 2022

    @marcofugaro
    Contributor

    Your repo starts successfully on my machine, it's a problem with your local dependencies. You should delete the node_modules and reinstall locally.

    image

  4. mr-akashdesai commented on Jul 25, 2022

    @mr-akashdesai
    Author

    Were you able to see the spline on the rendered component? The error is thrown within the developer tools console not in the terminal since it's not a syntax error. I created a new repo and reinstalled all the node modules, so I don't think that is the issue.

  5. mr-akashdesai commented on Jul 25, 2022

    @mr-akashdesai
    Author

    Reinstalled node_modules again, same issue still.
    image

  6. locked and limited conversation to collaborators on Jul 26, 2022
  7. converted this issue into a discussion #68 on Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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