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

Javascript Client App : Unexpected Token, BimServerClient is not defined #671

Closed
alilouchka opened this Issue Dec 20, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@alilouchka

alilouchka commented Dec 20, 2017

Hey,

I am trying to test a client wab app using BimServerClient api.

Everything is Ok when i load the librairies from :

2017-12-20_14h16_47

I got in the console :

image

But when i try to load them locally from :

2017-12-20_14h17_33

or from my local host :

image

I get the unexpected token error and BimServerClient is not defined :

image

Can you help me please !?

Thanks

@bdamay

This comment has been minimized.

Show comment
Hide comment
@bdamay

bdamay Dec 21, 2017

Few days ago i experienced that thisisanexperimentalserver was not serving the same files than the api installed with bimserverv1.5.92.
The bimserver install is serving modules so you need to specify <script type="module" ..> instead of <script type="text/javascript"... .
You might need to explicitly import BimServerClient from js/bimserverclient.js in your app, but i'm not sure of this.

bdamay commented Dec 21, 2017

Few days ago i experienced that thisisanexperimentalserver was not serving the same files than the api installed with bimserverv1.5.92.
The bimserver install is serving modules so you need to specify <script type="module" ..> instead of <script type="text/javascript"... .
You might need to explicitly import BimServerClient from js/bimserverclient.js in your app, but i'm not sure of this.

@alilouchka

This comment has been minimized.

Show comment
Hide comment
@alilouchka

alilouchka Dec 22, 2017

Thabks bdamay for your answer, i did all of this but it stills not working :

2017-12-22_13h16_03

Result:

2017-12-22_13h18_17

2017-12-22_13h18_25

Any solution please ? : )

Thanks

alilouchka commented Dec 22, 2017

Thabks bdamay for your answer, i did all of this but it stills not working :

2017-12-22_13h16_03

Result:

2017-12-22_13h18_17

2017-12-22_13h18_25

Any solution please ? : )

Thanks

@alilouchka

This comment has been minimized.

Show comment
Hide comment
@alilouchka

alilouchka Dec 22, 2017

can you try the code by your self and tell me if it's working or not please ?

<script type="module" src="js/bimserverapiwebsocket.js"></script> <script type="module" src="js/bimserverclient.js"></script> <script type="module" src="js/bimserverapipromise.js"></script> <script type="module" src="js/ifc2x3tc1.js"></script> <script type="module" src="js/ifc4.js"></script> <script type="module" src="js/model.js"></script> <script type="module" src="js/translations_en.js"></script> <script> // Create a new API, the path given should point to the base path of a BIMserver. This can also be a full URL like "http://bimserveraddress" import BimServerClient from 'js/bimserverclient.js' window.addEventListener('DOMContentLoaded', () => { var api = new BimServerClient("http://localhost:8082"); api.init((client, version) => { console.log(version.version); }); }); </script>

// Thanks : )

alilouchka commented Dec 22, 2017

can you try the code by your self and tell me if it's working or not please ?

<script type="module" src="js/bimserverapiwebsocket.js"></script> <script type="module" src="js/bimserverclient.js"></script> <script type="module" src="js/bimserverapipromise.js"></script> <script type="module" src="js/ifc2x3tc1.js"></script> <script type="module" src="js/ifc4.js"></script> <script type="module" src="js/model.js"></script> <script type="module" src="js/translations_en.js"></script> <script> // Create a new API, the path given should point to the base path of a BIMserver. This can also be a full URL like "http://bimserveraddress" import BimServerClient from 'js/bimserverclient.js' window.addEventListener('DOMContentLoaded', () => { var api = new BimServerClient("http://localhost:8082"); api.init((client, version) => { console.log(version.version); }); }); </script>

// Thanks : )

@bdamay

This comment has been minimized.

Show comment
Hide comment
@bdamay

bdamay Dec 22, 2017

did you try defining the type of the script itself with type="module" ?
line 13 <script type="module">

bdamay commented Dec 22, 2017

did you try defining the type of the script itself with type="module" ?
line 13 <script type="module">

@alilouchka

This comment has been minimized.

Show comment
Hide comment
@alilouchka

alilouchka Jan 1, 2018

Yes that's what i did buy with no success

alilouchka commented Jan 1, 2018

Yes that's what i did buy with no success

@rubendel rubendel closed this Sep 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment