Git Product home page Git Product logo

cue's People

Contributors

g-plane avatar

Watchers

 avatar  avatar

cue's Issues

Missing 'main' in package.json

I'm not entirely sure why, but the fact that package.json has an exports property and not a main property is breaking Jest for me.

My imports look like this:

import {
  File as CueFile, parse, Track, TrackDataType,
} from '@gplane/cue';

and I'm running Jest like this:

node --experimental-vm-modules ./node_modules/jest/bin/jest.js --verbose

and I'm getting the TypeScript error:

error TS2307: Cannot find module '@gplane/cue' or its corresponding type declarations.

    8 } from '@gplane/cue';
             ~~~~~~~~~~~~~

If I remove the exports property and replace it with "main": "./dist/index.js" the problem goes away for me.

It seems to only be Jest, I'm able to run my app fine like this:

node --loader ts-node/esm index.ts

Some version info:

  • Node.js v20.11.1

  • TypeScript v5.3.3

  • jest v29.7.0

  • ts-jest v10.9.2

  • With a fairly vanilla tsconfig.json:

    {
      "compilerOptions": {
        "target": "es6",                              
        "experimentalDecorators": true,               
        "emitDecoratorMetadata": true,                
        "module": "node16",                           
        "moduleResolution": "node16",                 
        "declaration": true,                          
        "sourceMap": true,                            
        "outDir": "./dist",                           
        "esModuleInterop": true,                      
        "forceConsistentCasingInFileNames": true,     
        "strict": true,                               
        "skipLibCheck": true                          
      },
      "ts-node": {
        "esm": true,
        "experimentalSpecifierResolution": "node",
      }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.