Comments (6)
@mendesbarreto Try version 2.0.3 - this removes the module type specifier.
Perhaps I'm missing something here, but I'd like to understand what's occurring in your environment. If you could share some details would help to trace this.
from lunarphase-js.
Ah, finally able to replicate this in a Node.js environment - I suppose that makes sense for Next.js
index.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
...although strangely I don't experience this issue in Next.js
This defeats the purpose of configuration, though:
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Need to research how other packages are handling this.
from lunarphase-js.
Strangely I don't receive this in Next.js
from lunarphase-js.
Both TypeScript and JavaScript are functional in Next.js, with different targets.
Even before when I used Rollup directly, CommonJS has always been distributed as .js
Can you give some insights to your Next.js config, and TSConfig if you're using TypeScript?
Are you using this as import
or require
?
from lunarphase-js.
@jasonsturges It's working now, thank you so much for your help.
Now your questions:
Are you using this as import or require?
We are using import
like:
import { Moon } from 'lunarphase-js';
It's quite odd because I've never encountered this issue with your library before. It only started happening after this recent change,
The command I am running is:
NODE_ENV=production next build
Let me know any specific details about our project here you want to know.
from lunarphase-js.
@mendesbarreto Thanks for the information.
Some issue interpreting ES Modules vs Common JS... I'll continue to trace it, and hopefully will match a similar environment with the issue.
from lunarphase-js.
Related Issues (20)
- Moonrise and Moonset calculations
- Full percent calculation
- UTC variant
- Distance as Apogee and Perigee
- Lunar Day Calculation HOT 6
- Moon.lunarPhase() anticipating moon phase HOT 11
- CDN HOT 6
- Full moon, new moon, first quarter, and last quarter too long HOT 3
- Primary and intermediate phases HOT 4
- Lunation number increases at full moon, not new moon? HOT 1
- New moon time is wrong HOT 2
- trading view has different moon phases than this HOT 1
- get future key dates HOT 1
- how to know which HEMISPHERE? HOT 3
- GitHub Action workflow for npm
- Vite upgrade
- DTS bundle generator
- GitHub Action workflow for pages
- consider adding multiple language, and next new moon/full moon? Here is my code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lunarphase-js.