# Import \* as BABYLON from '@babylon/core' throws error

**URL:** <https://forum.babylonjs.com/t/import-as-babylon-from-babylon-core-throws-error/35192>\
**Category:** Questions\
**Created:** [October 27, 2022, 9:05pm UTC](https://forum.babylonjs.com/t/import-as-babylon-from-babylon-core-throws-error/35192 "2022-10-27T21:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chickadeepi](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chickadeepi/32/27802_2.png) [@chickadeepi](https://forum.babylonjs.com/u/chickadeepi)\
**Post date:** [October 27, 2022, 9:05pm UTC](https://forum.babylonjs.com/t/import-as-babylon-from-babylon-core-throws-error/35192/1 "2022-10-27T21:05:09Z")

</div>

Hello!  
I’m super inexperienced to babylon.js and web development in general, so I might just be messing up something very basic. Also, apologies if this post is in the wrong category!

My file structure is as follows:  
migration-animation  
|—dist  
|—node\_modules  
|—src  
|—|—index.js  
|—index.html  
|—package-lock.json  
|—package.json

The commands I’ve run for this project so far are:  
npm init  
npm install @babylonjs/core --save  
npm install @babylonjs/materials --save  
npm install webpack webpack-cli webpack-dev-server --save-dev  
In the index.html file, I have:

```auto
<script type="module" src="./src/index.js"></script>

```

In the index.js file, I have:

```auto
import * as BABYLON from "@babylonjs/core/Legacy/legacy";

```

This causes the following error:

```auto
Uncaught TypeError: Failed to resolve module specifier "@babylonjs/core/Legacy/legacy". Relative references must start with either "/", "./", or "../".

```

Any advice would be much appreciated!

---

<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:** [October 27, 2022, 9:34pm UTC](https://forum.babylonjs.com/t/import-as-babylon-from-babylon-core-throws-error/35192/2 "2022-10-27T21:34:47Z")

</div>

It looks like you install webpack but are not using it.

As you are only starting web dev, before diving into packing and such I would suggest you rely on our cdn version: [The Very First Step | Babylon.js Documentation](https://doc.babylonjs.com/journey/theFirstStep)
