I'm trying to initialize LogRocket, using
official doc:
- successfully installed it with node:
npm i --save logrocket - But when trying to initiate it earlier on my page using
<script type="module">
// init LogRocket
import LogRocket from 'logrocket'
LogRocket.init("my/project/id")
</script>
I get this error Uncaught TypeError: Error resolving module specifier: logrocket.
Note that I can open the logrocket module by Cmd+click on the from 'logrocket'.
And I can use logrocket for non-npm approach
<script src="https://cdn.lr-ingest.io/LogRocket.min.js" crossorigin="anonymous"></script>
<script>window.LogRocket && window.LogRocket.init('my/project/id');</script>
Does anyone already faced such issue ? How to fix it ?
I think they at some point changed the way exporting, the doc is out-of-date.
Before I only succeed by using
But I just tried again now, both
work for me.
Tested on logrocket version 1.0.12