Unbound Breakpoint When Importing in CocosCreator

135 Views Asked by At

A game written in CocosCreator and "RUN AND DEBUG" on VS Code has the following line in a typescript file named index.ts:

                import {Server} from '../../websocket-server-ts/server';

(At runtime, index.ts will be loaded in http://localhost:7456, and the Websocketserver named server.ts will be listening at port:7481.)

Prior to launching CocosCreator, when I hover over the above line, VisualStudio recognizes the class "Server" to be in the module "/Desktop/Project-APP/websocket-server-ts/server".

However, when I launch (RUN AND DEBUG") CocosCreator, I get the following error:


            Unbound breakpoint
            Some of your breakpoints could not be set. If you're having an issue, you can                       troubleshoot your launch configuration.

             ✅ This breakpoint was initially set in:

             /Desktop/Project-APP/websocket-server-ts/server.ts line 3 column 1

            ❓ We couldn't find a corresponding source location, and didn't find any source with the name server.ts.
            How did you expect this file to be loaded? (If you have a compilation step, you should pick 'sourcemap')
             **Loaded in directly**           **Be parsed from a sourcemap**

I have tried multiple ways to repair the code as suggested above, but after repeated attempts, I have not been successful. Your help will be appreciated.

0

There are 0 best solutions below