Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import() function is not allowed (The module could not be parsed: ImportToken) #119

Open
srghma opened this issue Jul 24, 2020 · 2 comments

Comments

@srghma
Copy link

srghma commented Jul 24, 2020

when import webpack function is used

exports.lazyLoadedImport = function() {
  var x = import(
    './Example.Lazy.LazyLoaded.purs'
  )
  console.log(x)
  return x
}

it throws error -

  Unable to parse foreign module:

    examples/lazy/src/LazyLoadedImport.js


    The module could not be parsed:


    ImportToken {tokenSpan = TokenPn 50 2 11, tokenLiteral = "import", tokenComment = [WhiteSpace (TokenPn 49 2 10) " "]}

Expected

import() function should not be parsed as import token

@srghma
Copy link
Author

srghma commented Aug 18, 2020

@erikd could you suggest how to approach this issue, I would like to make pr


I think this is related to #115

@kim366
Copy link

kim366 commented Mar 10, 2021

For me the best thing would be to just treat it as a global function. My JS bundler then takes care of resolving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants