Coder Social home page Coder Social logo

URL.search is not implemented about repack HOT 4 CLOSED

jaysson avatar jaysson commented on May 23, 2024
URL.search is not implemented

from repack.

Comments (4)

zamotany avatar zamotany commented on May 23, 2024 1

whatwg-url related dependencies have to be transpiled by Babel in order to work. Metro transpiles everything by default, that's why it was working.

Add /node_modules(.*[/\\])+whatwg-url/ to include array for 1st babel-loader: https://github.com/callstack/repack/blob/main/templates/webpack.config.js#L148

Then you will be able to use import 'react-native-url-polyfill/auto' or to the entry array in webpack.config.js:

entry: [
    ...ReactNative.getInitializationEntries(reactNativePath, {
      hmr: devServer.hmr,
    }),
    'react-native-url-polyfill/auto',
    entry,
  ],

from repack.

zamotany avatar zamotany commented on May 23, 2024

This is the implementation for URL: https://github.com/facebook/react-native/blob/0.64-stable/Libraries/Blob/URL.js#L195 which is used by Metro and Re.Pack. I've checked both with Metro and Re.Pack and with both the not implemented error is thrown.
I'm curious how it was working before without Re.Pack. Do you have some polyfill for it?

from repack.

jaysson avatar jaysson commented on May 23, 2024

Sorry for not mentioning it in before. Using https://github.com/charpeni/react-native-url-polyfill

from repack.

jaysson avatar jaysson commented on May 23, 2024

That worked. Thank you so much.

from repack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.