# Running on server throws no-plugin error

**URL:** <https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483>\
**Category:** Questions\
**Created:** [July 26, 2022, 12:45am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483 "2022-07-26T00:45:16Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 13, 2022, 3:10pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/81 "2022-09-13T15:10:00Z")

</div>

Yup this has always been the case. We never supported loading images on node.

The only unexpected part for me is:

- 4.2 → load models but without textures
- 5.22 → load fully fails if texture not loaded

I guess it is actually an improvment overall as we are catching and surfacing image load issues 🙂

I do not think we should polyfill too much loading images and such as anyway rendering is not expected to work without extra dependencies.

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [September 14, 2022, 2:16am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/82 "2022-09-14T02:16:03Z")

</div>

My apology.

The part where I could load the model, but without textures was on v.5.17.1 with Next.js based project  
 → [GitHub - DOEHOONLEE/babylonTester](https://github.com/DOEHOONLEE/babylonTester)

On both v.5.17.x && v.5.22.x → still failing in Node.js project that I shared earlier ☹

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [September 14, 2022, 2:17am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/83 "2022-09-14T02:17:29Z")

</div>

Thanks for the thorough explanation! I now get what’s going on.  
Would there still be some sort of a workaround to load a model with textures ?

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [September 14, 2022, 5:58am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/84 "2022-09-14T05:58:57Z")

</div>

> Yup this has always been the case. We never supported loading images on node.

@sebavan , Does this mean that it is, for now, impossible to load a model with textures until further notice?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 14, 2022, 2:10pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/85 "2022-09-14T14:10:08Z")

</div>

There are a lot of other parts which won t be compatible unfortunately. In your case you might try to find a createImageBitmap polyfill for node ?

or rely on [Rendering Scenes On A Remote Server | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/scene/renderRemoteScreenshot) or BabylonNative

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [September 14, 2022, 2:24pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/86 "2022-09-14T14:24:11Z")

</div>

@sebavan

> There are a lot of other parts which won t be compatible unfortunately

which means… even if I solve this current problem, there will be more coming up? ☹

I thought Babylon Native is for mobile. Is there something unique about it that it can be used for server side rendering? If so, is there an example of it?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 14, 2022, 2:27pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/87 "2022-09-14T14:27:39Z")

</div>

Babylon native works differently. it doesn’t run on node and has everything needed implemented for you.  
Not sure if it is usable on server, maybe @bghgary can answer that. But in general it was meant for native applications (android, ios, windows)

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [September 14, 2022, 3:17pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/88 "2022-09-14T15:17:52Z")

</div>

Babylon Native is, err, for native C++ applications (i.e., Win32, UWP, Linux, Android, iOS) as @RaananW points out. We have an internal project using Babylon Native for a server scenario, but it’s still early. There are some changes needed on the JS side to support rendering to a render target texture.

Can you explain your scenario? That might help with the discussion.

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [September 15, 2022, 8:28am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/90 "2022-09-15T08:28:54Z")

</div>

Just one question to clarify the below.

So far, to conclude, we know that

1. `.gltf` model cannot be loaded in both `node.js` and `next.js` projects

2. in [`node.js` project,](https://github.com/DOEHOONLEE/babylonNodeJS) only `.babylon` model can be loaded

- **ONLY WHEN** the model does not have external textures with references

1. in [`next.js` project](https://github.com/DOEHOONLEE/babylonTester), `.babylon` model can be loaded

- **EVEN WHEN** the model has externl textures, but they are not mapped correctly

**Problem 1** is related to how I am importing `.gltf loader` on the server-side.

**Problem 2** is because Babylon uses createImageBitmap where it is not provided on the server-side.

## **QUESTION 1.**

Is the **Problem 3** same as **Problem 2**? I am a little confused how it is handled because in #2, it could not even load a model, but it did in #3. I just felt so close..!! ☹

## QUESTION 2.

In order for me to load a `.gltf` model, I have to solve the `createImageBitmap` problem AND **Problem 1** right?

Thank you all for the great help!!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 15, 2022, 3:00pm UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/91 "2022-09-15T15:00:10Z")

</div>

@DOEHOONLEE the only support we have for node.js is null engine that we use for tests for instance.

The normal engine will fail in a lot of ways due to objectUrl/images and sometimes shader usage during load. Node.js does not support rendering or the dom by default limiting a lot the default capabilities of rendering server side.

I would advise to either adapt and polyfiill all you need on node which might help others in the community or rely on Babylon Native which requires a different set of skills but has been proven to work to render server side at some extend.

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 14, 2022, 8:12am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/92 "2022-10-14T08:12:08Z")

</div>

I am using puppeteer for loading meshes and taking screenshots of them for now.

Just to share with the community,

**EDITED =\> The below content is for [server side rendering question on current discussion page + this [discussion](https://forum.babylonjs.com/t/texture-on-imported-mesh-mapped-incorrectly/32739/21)]**

- Loading `.babylon` mesh is successful.

- However, when the model has a texture URL reference, the mapping goes wrong and it does not really work like below (textures become all stripes)

 ![Screen Shot 2022-10-14 at 4.26.47 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/d/cd495ac14331f572215d92193ed28320db12b101.png)

**[Newly Found]**

- THOUGH, if url is updated with base64 with `updateURL(path)`, it does load the texture and maps around the mesh, but just in the wrong vertices(?)

- face is not correctly mapped below (ex. lips are not red)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/0/70d03ef94207e9803cc599be00a7bd47d847f7d9.jpeg)

- To make sure, I marked the face on the texture image with hotpink area and still get the same

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/6/b6e816fe6382dd673c87d47194631fa206850654.jpeg)

**HERE comes the funny part**

- When I map with this area marked texture on `Dude.babylon`

 ![marked](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/7/4778ac796bed37aa176c18b08da3bb610c58cd09.jpeg)

- I get this…!!

![Screen Shot 2022-10-14 at 5.06.21 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/1/910625f6e3e067a0579b445b903faecbd47a166a.png)

I tested with other meshes and it seems like, what it does is that, it does not map with the whole original image area, but it uses like 1/5 or 1/6? ish proportional area of its original image to map on the mesh.

Whatever the size is, however big the texture image is, it uses like 1/6 ish of its original image area.

So if I take the “yellow” area of the image I just showed above and make it a new image with the size of 290x253 (taken approximately here), it actually maps on the mesh like above.

![290_253](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/f/2f106f53cc2160b5f987f657036d62af1d12cc75.jpeg)  
 ![Screen Shot 2022-10-14 at 5.11.14 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/d/7d84321c03c9e6466fdff829c8a11b3160bd59f3.png)

Does this give us some hints on where it should be fixed…?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 14, 2022, 8:32am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/93 "2022-10-14T08:32:40Z")

</div>

We are using puppeteer to render samples in 3 different places in our framework - visualization tests, assets library and the docs repo (to generate the thumbnails). They all work asexpected.  
Is the behavior you are describing puppeteer-only? or does it happen in a regular browser session as well?

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 14, 2022, 8:34am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/94 "2022-10-14T08:34:32Z")

</div>

Oh, no no no.

I am working with puppeteer fine. The new message I just posted is for the “server side rendering” I tried to work before.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 14, 2022, 8:36am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/95 "2022-10-14T08:36:30Z")

</div>

Got it, sorry - i misread

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 14, 2022, 8:37am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/96 "2022-10-14T08:37:16Z")

</div>

![Screen Shot 2022-10-14 at 5.36.49 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/9/398f49210d004fe59f12be28c7c498a17d99e3bb.png)

I am sorry for the confusion. I edited the message to clarify.

It’s funny how the mapping does work, but uses different size!

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 14, 2022, 8:37am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/97 "2022-10-14T08:37:40Z")

</div>

Are there any changes to the uv scales of the texture? any change to anything related to the uv coordinates?

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 14, 2022, 8:41am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/98 "2022-10-14T08:41:47Z")

</div>

UV scales were same as original. I did not modify any UV Coordinates when loading meshes.

I still couldn’t work loading `.gltf` model, just working on loading `.babylon`. So no fancy stuff yet.

Just loading a model and updating texture URL only.

I posted a discussion with a sample project [here](https://forum.babylonjs.com/t/texture-on-imported-mesh-mapped-incorrectly/32739/21) with Next.js basis, but the behavior is the same in Node.js only project.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 14, 2022, 8:52am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/99 "2022-10-14T08:52:58Z")

</div>

there shouldn’t be a discrapency if you just change the texture. This is an interesting behavior of node TBH. but it does seem like it is providing you with a solution 🙂 You can actually try changing the u and v scale to see if it fixes the mapping.

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 14, 2022, 9:03am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/100 "2022-10-14T09:03:52Z")

</div>

Thanks for pointing out! Let me try that 🙂

---

<div class="post-metadata">

**Author:** ![DOEHOONLEE](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/doehoonlee/32/16289_2.png) [@DOEHOONLEE](https://forum.babylonjs.com/u/DOEHOONLEE)\
**Post date:** [October 16, 2022, 8:38am UTC](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483/101 "2022-10-16T08:38:54Z")

</div>

I wanted to find out specific part/area that it is being mapped so I created an image with randomly colored tiles like this.

 ![sampleTexture](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/4/c42216d3ffb450b50d8f7639782297754d615426.png)

When put on a cylinder (I’m sorry. I only have a cylinder made in `.babylon` for now. I’ll try to share a plane next week if I could. That way, it will be easier to see the difference here), it looks like this.

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/d/7d65db25b7d6b6435a16ec5370644cbe8abb344e.png)

I first, tried manipulating the scales and offsets on Babylon Sandbox and made it look like the one that I got from the server side rendering (just to see if modifying the values work).

 ![Screen Shot 2022-10-16 at 5.30.24 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/2/a2123ae3221590ed076b337a1e738c926b4a9c10.png)

Anyway, so now I have to change the values on the server side, but when I do, I get something like this

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/e/ee6a54995012f4d6bfa33854053943fc92173292.png)

I am not sure if you remember the message I posted a few days ago. I mentioned that it looks like it only uses SOME specific size (width/height) of an image regardless of its size.

 ![Screen Shot 2022-10-16 at 5.33.20 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/5/e5a2a8b670295656cf34d915706dd8a4c69bc5ce.png)

It looks like even whatever the offsets/scales are, it only uses the squared area…

 ![Screen Shot 2022-10-16 at 5.36.32 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/d/fddcec381701bde8cb8f7c2dd420337ec5485cae.png)

Any idea what might be wrong…?

[Previous page](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483.md?page=4)

[Next page](https://forum.babylonjs.com/t/running-on-server-throws-no-plugin-error/32483.md?page=6)
