Issue with Plasmic canvas host

I have an issue with the plasmic-canvas-host. My production site is all good, but I can’t get the pages to render on Plasmic. It’s definitely coming from the plasmic canvas host but I can’t seem to figure out exactly what’s happening and it’s only on this site, all other projects seem to be ok.
My initial approach was to reset the plasmic-init file to the barebones, basically removing any custom component and substitions, so I copied the project removed all the code (which prompted a couple of messages on Plasmic for me to remove all my custom components, which I did), but the project persisted so it’s not coming from there.
Next step was removing the plasmic-host by clearing it on the project setting in plasmic and it worked, just that I don’t have my components anymore.
I can’t discard an issue on my site, but it’s building without any errors, and it seems to be working fine so I don’t know how to sort this out

image.png

Actually it’s affecting other sites, so it can’t be something i did

Hi Daniel,
The issue usually happens when we wrongly import components. Let’s look into an example scenario.

function TestComponent(){
 return (
   <div>
     Test Component
   </div>
 )
}

export default TestComponent

The above component is a default export. If we tent to import it as follow

import {TestComponent} from "../path/to/component/TestComponent"

It will throw the error shared above because the import doesn’t found anything with named export of TestComponent.

It can occur if we do the vice versa such as below

function TestComponent(){
 return (
   <div>
     Test Component
   </div>
 )
}

export {TestComponent}

Note this time the component is named export, it will throw error if we import it as follow

import TestComponent from "../path/to/commponent/TestComponent"

Given that we understand the above error you can now investigate the issue in Plasmic. It can occur in Code Components registration process because of misconfiguration of the two properties in the registerComponent function call.

importPath: "../path/to/component/"
isDefaultExport: false/true

The importPath should be relative to the src directory. You need to verify those properties if they form a correct import path.

Let me know if that helps or you need further assistance.

(This should be fixed now, sorry! Turns out to be an issue with older versions of loader/host packages)

thanks guys for your quick replies…i simply should’ve updated the packages I don’t know why i didn’t do it to be honest. But really thanks for staying on top of this issues!

We will have better detection and messaging soon!