Path: csiph.com!news.uzoreto.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Anton Shepelev Newsgroups: comp.lang.javascript Subject: Re: Exposing a module in the current scope Date: Thu, 18 Mar 2021 23:57:03 +0300 Organization: A noiseless patient Spider Lines: 26 Message-ID: <20210318235703.ea4798e2fc9d01b5194a34ca@gmail.com> References: <20210318192107.08e2fac2d6aeada5596c4dd0@freeshell.de> <7921cdf5-084a-4011-9a0e-680e0b45c442n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: reader02.eternal-september.org; posting-host="4c71f1ef4b16ecf29336556e01ded7e0"; logging-data="16355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MkvhB8ucvAQnsQMZ6kFSwJiQwZHvrjg4=" Cancel-Lock: sha1:YtxyVJKbTK2KRG0ooCFzMzyta/U= X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Xref: csiph.com comp.lang.javascript:39694 Michael Haufe: > Are you using node js? Unfortunately, I am using a thing called SAP Hana XS (Classic): https://help.sap.com/viewer/d89d4595fae647eabc14002c0340a999/1.0.12/en-US which is not aware of `require' and complains about `import' that it must occur at the top level of a module, as if it were genuine NodeJS: https://answers.sap.com/questions/13319612/can-one-use-ecmascript-modules-in-a-hana-xs-applic.html > > Did you name the file *.mjs ? I have already read that document about ECMAScript modules in NodeJS, but it does not apply to Hana XS, where the files must have extension .xsjs. I tried playing with the `type' parameter in package.json, but it didn't help either. -- () ascii ribbon campaign -- against html e-mail /\ http://preview.tinyurl.com/qcy6mjc [archived]