witcher112 / electron-app-universal-protocol-client

Unified cross-platform protocol handler for Electron apps, supporting development environments.
MIT License
14 stars 5 forks source link

Why in the world do we need to use require instead of import? #5

Closed Galkon closed 1 day ago

Galkon commented 4 months ago

I couldn't get this working at all, until I found the example, which uses this:

const electronAppUniversalProtocolClient = require('electron-app-universal-protocol-client').default

This works. However, these do not:

import { default as electronAppUniversalProtocolClient } from 'electron-app-universal-protocol-client'
import electronAppUniversalProtocolClient from 'electron-app-universal-protocol-client'

This is literally the only module that I have that behaves like this. What gives?

obetame commented 1 month ago

for me:

import universalProtocol from 'electron-app-universal-protocol-client';
const protocolClient = (universalProtocol as any).default;
witcher112 commented 1 day ago

Added new export named electronAppUniversalProtocolClient in v2.1.0 : https://github.com/witcher112/electron-app-universal-protocol-client/releases/tag/v2.1.0