Recibo este mensaje de error cuando uso la declaración de importación, sucedió primero cuando intenté usar la biblioteca data-fns que usé en el pasado sin ningún problema y ahora estoy tratando de importar una clase de un archivo a otro y Recibo el mismo error. Ya intenté agregar "type": "module en package.json y he intentado agregar type="module" en el primer ejercicio, en el segundo ni siquiera estoy usando HTML en este momento, alguien sabe lo que podría ¿Será el motivo? ¿Tal vez instalé algo globalmente que está causando este problema? Editar: fotos cuando trato de usar broma
ShipFactory.js
class Ship { constructor(length) { this.length = length; this.ships = new Array(length); this.sunk = false; } hit(num) { ships[num] = true; } isSunk() { if (this.ships.every(true)) return true } } export default Ship;nave.prueba.js
import Ship from '../shipFactory.js'; describe('ship', () => { beforeEach(() => { let ship = new Ship(5) }) test('create ship', () => { expect(ship).toBe({length: 5}) }) })paquete.json
{ "name": "battleship", "type": "module", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "jest" }, "author": "", "license": "ISC" }Esto sucede cuando traté de usar jest, pero también sucedió con la biblioteca date-fns