codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.02k stars 2.27k forks source link

CI build in codesandbox seem to ignore `main` field in package.json #5128

Open phryneas opened 3 years ago

phryneas commented 3 years ago

🐛 bug report

Preflight Checklist

Description of the problem

Using a library like

import { QueryStatus } from '@rtk-incubator/simple-query';

does not work. Using the direct folder of the entry point like

import { QueryStatus } from '@rtk-incubator/simple-query/dist';

does though.

This happens only with CodeSandbox CI built packages. I uploaded the (apart from the package name) identical package to npm as @phryneas/rtk-simple-query@0.0.1-67b8bb3 and that works as expected.

To Reproduce

See this sandbox: https://codesandbox.io/s/rtk-simple-query-demo-forked-ykpf3?file=/src/features/posts/PostsManager.tsx

Changing the offending import either to

import { QueryStatus } from '@rtk-incubator/simple-query/dist';

or

import { QueryStatus } from '@phryneas/rtk-simple-query';

will make the build succeed - as mentioned: @phryneas/rtk-simple-query is exactly the same as @rtk-incubator/simple-query apart from one coming out of CSB CI and one coming from npm.

PS: this is the offending CI build, but this does seem to happen generally: https://ci.codesandbox.io/status/rtk-incubator/simple-query/pr/22/builds/72883

CompuIves commented 3 years ago

Not stale! This looks like a very valid issue, I will look into why this is happening. Apologies for the late reply on this.