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

Error: Element type is invalid: expected a string .... #83

Open
yleclanche opened this issue May 30, 2024 · 2 comments
Open

Error: Element type is invalid: expected a string .... #83

yleclanche opened this issue May 30, 2024 · 2 comments

Comments

@yleclanche
Copy link

Describe the bug

Hello, I followed the installation guide. My project is standard.
When I try to insert an image in one of my component :

<Image
    loaderUrl="/api/image"
    src="https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/images/bg-8.png"
    responsive={[
      {
        size: { width: 100, height: 100 },
        maxWidth: 500,
      },
      {
        size: { width: 600, height: 600 },
      },
    ]}
    dprVariants={[1, 3]}
  />

I get the following error :

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6120:9)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderChildrenArray (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6288:7)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6218:7)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderHostElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5708:3)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6029:5)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderChildrenArray (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6288:7)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6218:7)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6048:9)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderForwardRef (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5931:7)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6082:11)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderForwardRef (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5936:5)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6082:11)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderChildrenArray (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6288:7)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6218:7)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderHostElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5708:3)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6029:5)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderChildrenArray (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6288:7)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6218:7)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6048:9)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderForwardRef (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5931:7)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6082:11)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderForwardRef (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:5936:5)
    at renderElement (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6082:11)
    at renderNodeDestructiveImpl (/home/django/test/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Just add an image component.

Expected behavior

Image should be displayed.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Chrome
  • Version: Last version

Additional context

Is remix-image still maintainaid ? Are there alternatives ?

@vitto-moz
Copy link

have the same issue :(

@vitto-moz
Copy link

@yleclanche , change the import to

import { Image, remixImageLoader } from 'remix-image';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants