ruleeeer opened a new issue #8639:
URL: https://github.com/apache/skywalking/issues/8639


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   NodeJS Server Side Agent (apache/skywalking-nodejs)
   
   ### What happened
   
   
   
   When I use ESM syntax in node, it directly throws out `agent.start is not a 
function
   `,I just copied the usage from Readme like this 
   ``` 
   import agent from 'skywalking-backend-js';
   agent.start();
   ```
   
   
   But when i use `cjs` synatax
   ```
   const { default: agent } = require('skywalking-backend-js');
   
   agent.start() 
   ```
    it will work fine
   
   
   I can reproduce it in node v16 and node v14,lower versions I have not tried
   
   
   ### What you expected to happen
   
   work fine
   
   ### How to reproduce
   
   ``` base
   npm install skywalking-backend-js
   ```
   and write follow to `test.js`
   ```
   import agent from 'skywalking-backend-js';
   agent.start();
   ```
   ```
   node test.js
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to