The file path for "main" in package.json should be ./lib/index.js
Steps To Reproduce
- create a directory for reproduction and `cd` into it
- `yarn init -y`
- `yarn add @aws/clickstream-web`
- put the following in `index.js`:
const clickstream = require('@aws/clickstream-web')
console.debug(clickstream)
- run `node index.js`
Observe that the program crashes.
Expected behavior
The program outlined in the reproduction steps should successfully run to completion.
The fix is to update "main" to point to ./lib/index.js
Clickstream-Web Version
0.10.0
Node version
v20.11.0
TypeScript version
N/A
Relevant log output
<details>
<summary>Log Messages</summary>
INSERT LOG MESSAGES HERE
### Is this a regression?
Yes
### Regression additional context
_No response_
### Browser
N/A
### Additional context
Here is the output of the reproduction program:
node:internal/modules/cjs/loader:452
throw err;
^
Error: Cannot find module '/Users/harrison.marshall/Developer/reproduce-clickstream-issue/node_modules/@aws/clickstream-web/lib/index.ts'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:444:19)
at Module._findPath (node:internal/modules/cjs/loader:715:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (/Users/harrison.marshall/Developer/reproduce-clickstream-issue/index.js:1:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/harrison.marshall/Developer/reproduce-clickstream-issue/node_modules/@aws/clickstream-web/package.json',
requestPath: '@aws/clickstream-web'
}
Describe the bug
The file path for
"main"
inpackage.json
should be./lib/index.js
Steps To Reproduce
Expected behavior
The program outlined in the reproduction steps should successfully run to completion.
The fix is to update
"main"
to point to./lib/index.js
Clickstream-Web Version
0.10.0
Node version
v20.11.0
TypeScript version
N/A
Relevant log output
node:internal/modules/cjs/loader:452 throw err; ^
Error: Cannot find module '/Users/harrison.marshall/Developer/reproduce-clickstream-issue/node_modules/@aws/clickstream-web/lib/index.ts'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:444:19) at Module._findPath (node:internal/modules/cjs/loader:715:18) at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27) at Module._load (node:internal/modules/cjs/loader:985:27) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object. (/Users/harrison.marshall/Developer/reproduce-clickstream-issue/index.js:1:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/harrison.marshall/Developer/reproduce-clickstream-issue/node_modules/@aws/clickstream-web/package.json',
requestPath: '@aws/clickstream-web'
}