faisalman / ua-parser-js

"Unmask Your Traffic" - UAParser.js: The Essential Web Development Tool for User-Agent Detection
https://uaparser.dev/
GNU Affero General Public License v3.0
9.28k stars 1.19k forks source link

Generated ESM Helper mjs file has incorrect import paths #759

Closed ComputerWolf closed 2 weeks ago

ComputerWolf commented 2 weeks ago

Library version 2.0.0-rc.1

Describe the bug Imports in the helper mjs file don't match the actual paths and throw errors.

Incorrect generated ESM file:

import { CPU, OS, Engine } from './enums/ua-parser-enums.mjs';
import { UAParser } from './main/ua-parser.mjs';

Correct paths from source file:

const { UAParser } = require('../main/ua-parser');
const { CPU, OS, Engine } = require('../enums/ua-parser-enums');

To Reproduce Steps to reproduce the behavior:

  1. Import helper into ESM application. eg: import { isStandalonePWA } from 'ua-parser-js/helpers';
  2. Attempt to run application.

Expected behavior Imports do not throw errors